/* ============================================================
   ledger.css, the Operator's Ledger shared chrome stylesheet.
   Owns: nav (desktop + mobile panel), 4-column footer, mobile
   sticky bar, and the canon components (.ledger-line,
   .record-strip, .status-line, .cap) plus .btn-red/.btn-ghost.
   Source of truth: index.html inline CSS as of 2026-08-03.
   Every var() carries a literal fallback so this file works on
   pages that do not define the palette variables inline.
   Canon: cream #f4f1ea, ink #1b2230, red #c63341. No pills,
   no gradients. .nav-cta keeps white-space:nowrap, always.
   ============================================================ */

/* ============ NAV, DESKTOP ============ */
nav.nav,
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: calc(1.2rem + var(--safe-top, env(safe-area-inset-top, 0px))) 3rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-surface, rgba(244,241,234,0.92));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line, rgba(20,29,34,0.08));
  transition: all 0.3s ease;
}

.nav::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--safe-top, env(safe-area-inset-top, 0px)));
  height: var(--safe-top, env(safe-area-inset-top, 0px));
  background: var(--nav-surface, rgba(244,241,234,0.92));
  pointer-events: none;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.nav-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: invert(1) brightness(0.2);
}

.nav-logo-text {
  font-family: var(--sans, 'DM Sans', system-ui, -apple-system, sans-serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text, #1b2230);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-soft, #45494f);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text, #1b2230); }

/* Client Login: same .nav-links style, visually de-emphasized.
   The old green-bordered .nav-login button treatment is retired. */
.nav-login {
  color: var(--text-muted, #707682) !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.nav-login:hover {
  color: var(--text, #1b2230) !important;
  background: transparent !important;
  transform: none;
  box-shadow: none;
}

.nav-cta {
  white-space: nowrap;
  background: var(--accent, #c63341);
  color: #ffffff !important;
  padding: 0.75rem 1.6rem;
  border-radius: 4px;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  transition: all 0.3s !important;
  box-shadow: 0 4px 20px var(--red-glow, rgba(198,51,65,0.22));
}

.nav-cta:hover {
  background: var(--accent-hover, #a82a37);
  transform: translateY(-1px);
  box-shadow: 0 6px 30px var(--red-glow, rgba(198,51,65,0.22));
}

/* ============ NAV, MOBILE TOGGLE + PANEL ============ */
.mobile-nav-toggle,
.mobile-nav-panel,
.mobile-nav-backdrop {
  display: none;
}

.mobile-nav-toggle {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(20,29,34,0.14);
  background: rgba(20,29,34,0.02);
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.mobile-nav-toggle:hover {
  border-color: rgba(20,29,34,0.24);
  background: rgba(20,29,34,0.06);
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text, #1b2230);
  border-radius: 2px;
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.mobile-nav-open .mobile-nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.mobile-nav-open .mobile-nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.mobile-nav-open .mobile-nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1098;
}

.mobile-nav-panel {
  position: fixed;
  top: calc(var(--mobile-nav-top, 84px) + 8px);
  left: 1rem;
  right: 1rem;
  background: rgba(244,241,234,0.99);
  border: 1px solid var(--line, rgba(20,29,34,0.08));
  border-radius: 14px;
  padding: 0.65rem;
  z-index: 1099;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 20px 44px rgba(20,29,34,0.16);
}

.mobile-nav-panel a {
  display: block;
  color: var(--text-soft, #45494f);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 0.9rem;
  border-radius: 9px;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-panel a:hover,
.mobile-nav-panel a:focus-visible {
  background: rgba(20,29,34,0.06);
  color: var(--text, #1b2230);
  outline: none;
}

/* Indented spoke rows under Services. Always visible, no accordion. */
.mobile-nav-panel .mobile-nav-sub {
  padding-left: 1.9rem;
  font-size: 0.72rem;
  color: var(--text-muted, #707682);
}

/* Client Login row, de-emphasized. Old green border treatment retired. */
.mobile-nav-panel .mobile-nav-login {
  color: var(--text-muted, #707682);
  border: 0;
  text-align: left;
}

.mobile-nav-panel .mobile-nav-login:hover {
  color: var(--text, #1b2230);
  background: rgba(20,29,34,0.06);
}

.mobile-nav-panel .mobile-nav-cta {
  margin-top: 0.35rem;
  background: var(--accent, #c63341);
  color: #ffffff !important;
  text-align: center;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 24px rgba(198,51,65,0.28);
}

.mobile-nav-panel .mobile-nav-cta:hover {
  background: var(--accent-hover, #a82a37);
}

body.mobile-nav-open .mobile-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-nav-open .mobile-nav-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ============ MOBILE STICKY BAR, SINGLE BUTTON ============ */
.mobile-sticky {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1097;
  padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  background: rgba(244,241,234,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-strong, rgba(20,29,34,0.16));
}

.sticky-book {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent, #c63341);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(198,51,65,0.28);
  transition: transform 0.25s ease, background 0.25s ease;
}

.sticky-book:hover {
  transform: translateY(-1px);
  background: var(--accent-hover, #a82a37);
}

body.mobile-nav-open .mobile-sticky {
  opacity: 0;
  pointer-events: none;
}

/* ============ FOOTER, 4 MONO COLUMNS ============ */
.site-footer {
  padding: 4rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  border-top: 1px solid var(--line, rgba(20,29,34,0.08));
  background: var(--bg, #f4f1ea);
  text-align: left;
}

.site-footer .footer-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.site-footer .ledger-line {
  margin-bottom: 2.2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem 2rem;
}

.footer-col-title {
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #707682);
  margin: 0 0 0.9rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-block;
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-soft, #45494f);
  text-decoration: none;
  padding: 0.3rem 0;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text, #1b2230);
}

.footer-links .footer-tel {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text, #1b2230);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-note {
  display: inline-block;
  font-family: var(--sans, 'DM Sans', system-ui, -apple-system, sans-serif);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted, #707682);
  padding: 0.3rem 0;
}

.footer-bottom {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line, rgba(20,29,34,0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem 2rem;
}

.footer-bottom p {
  margin: 0;
}

.site-footer .footer-legal {
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted, #707682);
}

/* ============ CANON COMPONENTS ============ */
.ledger-line {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line-strong, rgba(20,29,34,0.16));
  padding-top: 10px;
}

.ledger-line::before {
  content: "";
  width: 22px;
  height: 3px;
  background: var(--accent, #c63341);
  margin-top: -12px; /* sits ON the rule */
  flex: none;
}

.ledger-line .ll-label {
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted, #707682);
}

.ledger-line .ll-num {
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 12px;
  color: var(--text-subtle, #8a8f98);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.record-strip {
  border-top: 1px solid var(--line-strong, rgba(20,29,34,0.16));
  border-bottom: 1px solid var(--line-strong, rgba(20,29,34,0.16));
}

.record-strip .rec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  gap: 1rem;
  min-width: 0;
}

.record-strip .rec + .rec {
  border-top: 1px solid var(--line, rgba(20,29,34,0.08));
}

.rec .rec-label {
  font-size: 14px;
  color: var(--text-soft, #45494f);
}

.rec .rec-fig {
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1b2230);
}

.status-line {
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-soft, #45494f);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-line .sq {
  width: 8px;
  height: 8px;
  background: var(--accent, #c63341);
  flex: none;
}

.cap {
  display: block;
  font-family: var(--mono, 'JetBrains Mono', Menlo, Consolas, monospace);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #707682);
  margin-top: 0.55rem;
}

.cap .cap-note {
  display: block;
  font-family: var(--sans, 'DM Sans', system-ui, -apple-system, sans-serif);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft, #45494f);
  margin-top: 0.25rem;
}

.arr {
  display: inline-block;
  vertical-align: -0.08em;
  margin-left: 6px;
}

/* ============ BUTTONS ============ */
.btn-red {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--accent, #c63341);
  color: #ffffff;
  padding: 1rem 1.85rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(20,29,34,0.06));
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn-red:hover {
  transform: translateY(-1px);
  background: var(--accent-hover, #a82a37);
  box-shadow: var(--shadow, 0 6px 20px rgba(20,29,34,0.08));
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line-strong, rgba(20,29,34,0.16));
  color: var(--text-soft, #45494f);
  padding: 1rem 1.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  border-color: var(--text, #1b2230);
  color: var(--text, #1b2230);
  background: rgba(20,29,34,0.03);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .nav-links { display: none; }

  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    z-index: 1102;
  }

  .mobile-nav-panel,
  .mobile-nav-backdrop {
    display: block;
  }

  nav.nav,
  .nav {
    top: 0;
    z-index: 1100;
    padding: calc(0.8rem + var(--safe-top, env(safe-area-inset-top, 0px))) 1rem 0.8rem;
    background: rgba(244,241,234,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .nav::before {
    background: rgba(244,241,234,0.97);
  }

  .nav-logo-img { height: 32px; }

  .nav-logo {
    min-width: 0;
    flex: 1;
    max-width: calc(100% - 56px);
  }

  .nav-logo-text {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-sticky {
    display: block;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-cta,
  .mobile-nav-toggle span,
  .mobile-nav-panel,
  .mobile-nav-backdrop,
  .sticky-book,
  .btn-red,
  .btn-ghost {
    transition: none;
  }
}
