/* Bilal Zia & Co. — ledger pad
   Paper, rules and inks are taken from an accountant's columnar pad:
   pale green paper, green rules, a double red margin line, blue-black ink. */

:root {
  --paper: #EEF4EA;
  --paper-2: #E1ECDB;
  --sheet: #FAFCF7;
  --rule: #A9C4A4;
  --rule-soft: #CBDCC6;
  --ink: #14231C;
  --ink-2: #41554A;
  --red: #C2362B;
  --blue: #1F3A8A;

  --display: "Besley", "Clarendon", Georgia, serif;
  --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;

  --margin: clamp(16px, 5.5vw, 84px);   /* where the red margin line sits */
  --gutter: clamp(18px, 2.4vw, 34px);   /* paper between the line and the text */
  --row: 46px;                          /* ledger row height */
  --page: 1240px;                       /* widest the sheet gets */
  /* the margin line stays with the sheet when the window is wider than it */
  --line: calc(max(0px, (100% - var(--page)) / 2) + var(--margin));
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* The double red margin line, full height of the page */
body::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--line);
  width: 4px;
  border-left: 1px solid var(--red);
  border-right: 1px solid var(--red);
  opacity: .75;
  pointer-events: none;
  z-index: 3;
}

h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: calc(var(--margin) + var(--gutter));
  padding-right: clamp(18px, 4vw, 56px);
}

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 20; border-radius: 2px;
}
.skip:focus { left: calc(var(--margin) + var(--gutter)); }

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

/* ---------- top bar ---------- */

.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.top__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 68px;
}
.mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 12px;
}
.mark__logo { height: 34px; width: auto; flex: none; fill: var(--ink); }
.mark__amp { color: var(--red); font-weight: 500; }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav a {
  font-size: .94rem; font-weight: 500;
  text-decoration: none; color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav .nav__cta {
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 7px 16px; border-radius: 2px;
}
.nav .nav__cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 18px;
}

h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.022em; }

h1 {
  font-size: clamp(2.7rem, 5.3vw, 5rem);
  line-height: 1.02;
  max-width: 12.5ch;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.9rem);
  line-height: 1.1;
  max-width: 20ch;
  text-wrap: balance;
}
p, li, dd { text-wrap: pretty; }

.lead {
  font-size: clamp(1.08rem, 1.45vw, 1.26rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 1rem;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 2px;
  border: 1px solid var(--ink);
  transition: background .18s ease, color .18s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--paper:hover { background: transparent; color: var(--paper); }

.link {
  font-weight: 600; color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.link:hover { text-decoration-thickness: 2px; }

/* ---------- hero ---------- */

.hero { padding: clamp(56px, 8vw, 118px) 0 clamp(64px, 8vw, 120px); }
.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 84px);
  align-items: center;
}
.hero__act { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 30px; margin-top: 38px; }

/* The reconciliation statement */
.recon {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 0 var(--rule-soft), 0 22px 44px -28px rgba(20, 35, 28, .38);
  font-size: .97rem;
  overflow: hidden;
}
.recon__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 18px 22px 16px;
  border-bottom: 2px solid var(--ink);
}
.recon__title { font-family: var(--display); font-weight: 600; font-size: 1.12rem; }
.recon__date, .recon__cols, .fig { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.recon__date { font-size: .8rem; color: var(--ink-2); white-space: nowrap; }

.recon__cols, .recon__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5em;
  align-items: center;
}
.recon__cols > span, .recon__row > span { padding: 0 22px; }
.recon__cols > span:last-child, .recon__row > span:last-child {
  text-align: right;
  border-left: 1px solid var(--rule);
  align-self: stretch;
  display: flex; align-items: center; justify-content: flex-end;
}
.recon__cols {
  height: 34px;
  font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.recon__row { min-height: var(--row); border-bottom: 1px solid var(--rule-soft); }
.recon__row > span:first-child { padding-top: 11px; padding-bottom: 11px; line-height: 1.35; }
.recon__row--c { border-bottom: 0; font-weight: 600; }

.fig { font-size: 1rem; color: var(--blue); }
.fig--total {
  position: relative;
  color: var(--ink);
  font-weight: 500;
  gap: 12px;
}
/* accountant's double underline under a final figure */
.fig--total::after {
  content: "";
  position: absolute; right: 22px; bottom: 8px;
  width: 5.5em; height: 4px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.tick { width: 24px; height: 20px; overflow: visible; }
.tick path {
  fill: none; stroke: var(--red); stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 0;
}
.recon figcaption {
  padding: 13px 22px 15px;
  font-size: .8rem; color: var(--ink-2);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

/* one orchestrated moment: the statement is posted line by line, then agreed */
@media (prefers-reduced-motion: no-preference) {
  .recon__row { opacity: 0; transform: translateY(6px); animation: post .5s ease forwards; }
  .recon__row--a { animation-delay: .35s; }
  .recon__row--b { animation-delay: .85s; }
  .recon__row--c { animation-delay: 1.4s; }
  .tick path { stroke-dashoffset: 40; animation: draw .45s ease-out 2s forwards; }
  .fig--total::after { transform: scaleX(0); transform-origin: right; animation: rule .35s ease-out 1.75s forwards; }
}
@keyframes post { to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rule { to { transform: scaleX(1); } }

/* ---------- sections ---------- */

.sec { position: relative; padding: clamp(64px, 8vw, 116px) 0; border-top: 1px solid var(--rule); }

/* folio label, written up the narrow column left of the margin line */
.sec::before {
  content: attr(data-label);
  position: absolute;
  top: clamp(64px, 8vw, 116px);
  left: calc(var(--line) - 30px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-2);
  z-index: 4;
}

.sec__head { margin-bottom: clamp(36px, 4.5vw, 60px); }
.sec__intro { color: var(--ink-2); max-width: 60ch; margin-top: 20px; font-size: 1.06rem; }

/* ---------- services: T-accounts ---------- */

.accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 2.6vw, 38px);
}
.acct {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: flex; flex-direction: column;
}
.acct__head {
  padding: 26px 28px 22px;
  border-bottom: 2px solid var(--ink);   /* the bar of the T */
}
.acct__head h3 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.28rem, 1.9vw, 1.55rem);
  line-height: 1.2; letter-spacing: -.012em;
}
.acct__head p { color: var(--ink-2); font-size: .97rem; margin-top: 8px; max-width: 50ch; }

.acct__body { display: grid; grid-template-columns: 1.15fr 1fr; flex: 1; }
.acct__side { padding: 20px 26px 28px 28px; }
.acct__side--cr { border-left: 2px solid var(--ink); padding-left: 26px; }  /* the stem of the T */

.acct__side h4 {
  font-family: var(--mono); font-weight: 500;
  font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.acct__side li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: .96rem; line-height: 1.45;
}
.acct__side li:last-child { border-bottom: 0; }
.acct__side li::before {
  content: "";
  position: absolute; left: 2px; top: 1.22em;
  width: 9px; height: 1px; background: var(--ink-2);
}
/* delivered items carry an audit tick */
.acct__side--cr li::before {
  left: 0; top: .95em;
  width: 15px; height: 13px; background: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 24'%3E%3Cpath d='M3 13.5 10 20 25 3.5' fill='none' stroke='%23C2362B' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
}

/* ---------- Fincountant ---------- */

.product { background: var(--ink); color: var(--paper); border-top: 0; }
.product.sec::before { color: var(--rule); }
.product .eyebrow { color: var(--rule); }
.product__in {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}
.product h2 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); margin-bottom: 24px; }
.product__copy p { color: #D5E2CF; max-width: 46ch; }
.product__copy p + p { margin-top: 16px; }
.product__copy .btn { margin-top: 32px; }
.product__copy .note { font-size: .84rem; color: var(--rule); margin-top: 14px; }

.modules { border-top: 1px solid rgba(169, 196, 164, .45); }
.modules > div {
  display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr);
  gap: 6px 28px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(169, 196, 164, .45);
}
.modules dt { font-family: var(--display); font-weight: 600; font-size: 1.06rem; line-height: 1.3; }
.modules dd { color: #C6D6C0; font-size: .96rem; line-height: 1.5; }

/* ---------- approach ---------- */

.rules {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}
.rules article { padding: 26px 30px 30px 0; }
.rules article + article { border-left: 1px solid var(--rule); padding-left: 30px; }
.rules h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.24rem; line-height: 1.25; letter-spacing: -.01em;
  margin-bottom: 12px;
}
.rules p { color: var(--ink-2); font-size: .99rem; }

.local {
  margin-top: clamp(34px, 4vw, 54px);
  padding: 22px 26px;
  background: var(--paper-2);
  border-left: 3px solid var(--ink);
  max-width: 76ch;
  font-size: .99rem;
}

/* ---------- contact ---------- */

.contact__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 84px);
  align-items: center;
}
.contact__card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 30px 30px 12px;
}
.mail {
  display: inline-block;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 2.5vw, 1.95rem);
  letter-spacing: -.015em;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
  overflow-wrap: anywhere;
  margin-bottom: 22px;
}
.mail:hover { text-decoration-thickness: 2px; }
.contact__card dl > div {
  display: grid; grid-template-columns: 7.5em minmax(0, 1fr);
  min-height: var(--row); align-items: center;
  border-top: 1px solid var(--rule-soft);
}
.contact__card dt {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
}
.contact__card dd a { color: var(--blue); text-underline-offset: 4px; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--rule); padding: 28px 0 34px; font-size: .9rem; color: var(--ink-2); }
.foot__in { display: flex; justify-content: space-between; align-items: center; gap: 18px 28px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- narrower screens ---------- */

@media (max-width: 1020px) {
  .hero__in, .product__in, .contact__in { grid-template-columns: minmax(0, 1fr); }
  .accounts { grid-template-columns: minmax(0, 1fr); }
  h1 { max-width: 13ch; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  :root { --gutter: 16px; }
  .sec::before { display: none; }
  .nav a:not(.nav__cta) { display: none; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .rules article { padding: 22px 0; }
  .rules article + article { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
  .modules > div { grid-template-columns: minmax(0, 1fr); }
  .recon__cols, .recon__row { grid-template-columns: minmax(0, 1fr) 8.6em; }
  .recon__cols > span, .recon__row > span { padding: 0 14px; }
  .recon__head { padding: 16px 14px 14px; }
  .recon figcaption { padding: 12px 14px 14px; }
  .fig--total::after { right: 14px; }
  .recon__row > span:first-child { padding-top: 10px; padding-bottom: 10px; line-height: 1.35; }
}

@media (max-width: 560px) {
  .acct__body { grid-template-columns: minmax(0, 1fr); }
  .acct__side { padding: 18px 20px 20px; }
  .acct__side--cr { border-left: 0; border-top: 2px solid var(--ink); padding-left: 20px; }
  .acct__head { padding: 22px 20px 18px; }
  .contact__card { padding: 24px 20px 8px; }
}

@media print {
  .top, .skip { display: none; }
  body::before { display: none; }
  .product { background: none; color: var(--ink); }
}
