/* The Back Pocket CFO: site styles
   Palette (locked): Slate Navy #34465A, Warm White #F7F5F0, Champagne Gold #C8B27A, Muted Teal #6F9994.
   Teal and gold are decorative only: they do not meet contrast for text on warm white. */

@font-face { font-family: "Inter"; src: url("../fonts/inter-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/inter-display-700.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --navy: #34465a;
  --navy-deep: #304356;
  --warm: #f7f5f0;
  --gold: #c8b27a;
  --teal: #6f9994;
  --slate: #4e6379;            /* secondary text: 5.7:1 on warm white */
  --line: rgba(52, 70, 90, 0.16);
  --tint: rgba(52, 70, 90, 0.045);
  --tint-solid: #eeede9;        /* tint over warm white, as a solid colour so slanted edges match */
  --paper: #fcfbf8;
  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1160px;
  --slant: clamp(28px, 4.5vw, 64px);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Inter Display", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--warm); color: var(--navy);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 { margin: 0 0 0.5em; font-family: var(--font-head); font-weight: 700; letter-spacing: -0.022em; line-height: 1.1; color: inherit; }
h1 { font-size: clamp(2.45rem, 1.5rem + 3.6vw, 4.1rem); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 1.3rem + 1.9vw, 2.95rem); }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.22rem; letter-spacing: -0.01em; line-height: 1.25; }
.lead { font-size: clamp(1.1rem, 1rem + 0.45vw, 1.32rem); line-height: 1.55; color: var(--slate); max-width: 40em; }
.muted { color: var(--slate); }
.small { font-size: 0.9rem; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .section--dark :focus-visible, .site-footer :focus-visible { outline-color: var(--warm); }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--navy); color: var(--warm); padding: 0.7rem 1rem; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.chart .g { stroke: #34465a; stroke-opacity: .12; stroke-width: 1; }
.chart .ax { stroke: #34465a; stroke-opacity: .35; stroke-width: 1.2; }
.chart .t { font: 500 13px var(--font-body); fill: #4e6379; }
.chart .tb { font: 600 13.5px var(--font-body); fill: #34465a; }
.hero--tool h1 { max-width: 16ch; }
.hero--tool .checks { margin: 1.4rem 0 0; display: grid; gap: 0.6rem; }
.products-cta { margin-top: 2.2rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 245, 240, 0.94); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav-list { display: flex; align-items: center; gap: 1.7rem; }
.nav-list a { text-decoration: none; font-weight: 500; font-size: 0.97rem; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav-list a:hover { border-bottom-color: var(--gold); }
.nav-list a[aria-current="page"] { border-bottom-color: var(--navy); font-weight: 600; }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; padding: 0.85rem 1.4rem; border-radius: 999px; font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn-primary { background: var(--navy); color: var(--warm); }
.btn-primary:hover { background: var(--navy-deep); text-decoration: none; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: var(--warm); text-decoration: none; }
.btn-light { background: var(--warm); color: var(--navy); }
.btn-light:hover { background: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost-light { background: transparent; color: var(--warm); border-color: rgba(247, 245, 240, 0.55); }
.btn-ghost-light:hover { background: rgba(247, 245, 240, 0.12); border-color: var(--warm); text-decoration: none; }
.btn-sm { padding: 0.6rem 1.05rem; font-size: 0.93rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---------- Icons ---------- */
.icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-badge { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--navy); color: var(--warm); margin-bottom: 1.1rem; position: relative; }
.icon-badge::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 14px; height: 14px; background: var(--gold); border-radius: 3px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.icon-badge .icon { width: 26px; height: 26px; }
.on-dark .icon-badge { background: var(--warm); color: var(--navy); }

/* ---------- Eyebrow / rules ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); margin-bottom: 1.2rem; }
.eyebrow::before { content: ""; width: 32px; height: 2px; background: var(--gold); }
.on-dark .eyebrow { color: var(--gold); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 7vw, 6.5rem) clamp(4rem, 8vw, 7rem); }
.hero::before { content: ""; position: absolute; right: -8%; top: -12%; width: 62%; height: 130%; background: var(--tint); clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { margin-bottom: 0.45em; }
.hero h1 .line { display: block; }
.hero .lead { margin-bottom: 1.9rem; }
.hero-note { margin-top: 1.4rem; font-size: 0.93rem; color: var(--slate); display: flex; align-items: center; gap: 0.6rem; }
.hero-note .dot { width: 8px; height: 8px; background: var(--teal); border-radius: 2px; transform: rotate(45deg); }

.viz { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.35rem 1.35rem 1.1rem; box-shadow: 0 1px 0 rgba(52,70,90,.05), 0 24px 48px -28px rgba(52,70,90,.35); }
.viz::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 64px; height: 64px; background: var(--gold); border-bottom-right-radius: var(--radius-lg); clip-path: polygon(100% 0, 100% 100%, 0 100%); opacity: .9; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.6rem; }
.viz-title { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.viz-sub { font-size: 0.82rem; color: var(--slate); }
.tag { display: inline-block; padding: 0.22rem 0.62rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate); background: var(--warm); white-space: nowrap; }
.viz svg.chart { width: 100%; height: auto; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem; font-size: 0.82rem; color: var(--slate); margin-top: 0.5rem; padding-right: 4rem; }
.viz-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.sw { width: 18px; height: 0; border-top: 2.5px solid var(--navy); }
.sw.dash { border-top: 2.5px dashed var(--teal); }
.sw.mark { width: 10px; height: 10px; border: 0; background: var(--gold); border-radius: 2px; transform: rotate(45deg); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.4rem); }
.section-head p:not(.eyebrow) { color: var(--slate); font-size: 1.12rem; }
.section--tint { background: var(--tint-solid); }
.section--dark { position: relative; background: var(--navy); color: var(--warm); padding-block: calc(var(--slant) + clamp(2.6rem, 6vw, 5.5rem)); }
.section--dark::before, .section--dark::after { content: ""; position: absolute; left: 0; right: 0; height: var(--slant); background: var(--warm); pointer-events: none; }
.section--dark::before { top: -1px; height: calc(var(--slant) + 1px); clip-path: polygon(0 0, 100% 0, 0 100%); }
.section--dark.prev-tint::before { background: var(--tint-solid); }
.section--dark.no-bottom { padding-bottom: clamp(2.6rem, 6vw, 5.5rem); }
.section--dark.no-bottom::after { display: none; }
.section--dark::after { bottom: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.section--dark .muted, .section--dark .section-head p:not(.eyebrow) { color: #c7d0d9; }
.section--dark .btn-secondary { color: var(--warm); border-color: rgba(247,245,240,.55); }
.section--dark .btn-secondary:hover { background: var(--warm); color: var(--navy); }
.after-dark { margin-top: calc(var(--slant) * -0.2); }

.grid { display: grid; gap: clamp(1rem, 2vw, 1.6rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem 1.6rem 1.6rem; position: relative; }
.card p { color: var(--slate); margin-bottom: 0; }
.card h3 { margin-bottom: 0.5rem; }
.card--link { text-decoration: none; display: block; transition: transform .15s ease, box-shadow .15s ease; }
.card--link:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -26px rgba(52,70,90,.5); text-decoration: none; }
.card .tag { display: block; width: fit-content; margin-bottom: 1rem; }
.card-foot { margin-top: 1.2rem; font-weight: 600; font-size: 0.95rem; display: inline-flex; gap: 0.4rem; align-items: center; }
.card-foot .icon { width: 1.05em; height: 1.05em; }

.audience { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.audience li { padding: 0.5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 500; font-size: 0.97rem; }

.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.4vw, 2rem); position: relative; z-index: 1; }
.pillar { border: 1px solid rgba(247,245,240,.22); border-radius: var(--radius-lg); padding: clamp(1.6rem, 3vw, 2.4rem); background: rgba(247,245,240,.04); }
.pillar .label { display: flex; align-items: center; gap: 0.7rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; color: var(--warm); margin-bottom: 0.9rem; }
.pillar .label::before { content: ""; width: 22px; height: 2px; background: var(--gold); }
.pillar h3 { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.02em; margin-bottom: 0.7rem; }
.pillar p { color: #d6dde4; }
.pillar ul { margin-top: 1.2rem; display: grid; gap: 0.55rem; }
.checks li { position: relative; padding-left: 1.7rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.8rem; height: 0.8rem; background: var(--gold); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.checks--navy li::before { background: var(--navy); }
.pillar .checks li::before { background: var(--gold); }

.method-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.method-list li { display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.method-list .n { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--slate); }
.method-list strong { display: block; font-weight: 600; margin-bottom: 0.15rem; }
.method-list span { color: var(--slate); }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.6rem); }
.step { position: relative; padding-top: 3.1rem; }
.step::before { counter-increment: step; content: "0" counter(step); position: absolute; top: 0; left: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.step::after { content: ""; position: absolute; top: 0.8rem; left: 2.4rem; right: 0; border-top: 1.5px solid var(--gold); }
.step p { color: var(--slate); margin: 0; }

.status { display: inline-flex; align-items: center; gap: 0.5rem; }
.status::before { content: ""; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); border-radius: 1px; }

.cta-band { text-align: left; }
.cta-band h2 { max-width: 18ch; }
.cta-band p { max-width: 38em; }
.cta-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; position: relative; z-index: 1; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: flex-start; }
.closing { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; }

/* ---------- Page heads ---------- */
.page-head { position: relative; overflow: hidden; padding-block: clamp(3rem, 6vw, 5.5rem) clamp(2.4rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.page-head::after { content: ""; position: absolute; right: 0; top: 0; width: min(38%, 440px); height: 100%; background: var(--tint); clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%); pointer-events: none; }
.page-head > .wrap { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(2.3rem, 1.4rem + 3.2vw, 3.8rem); max-width: 18ch; }
.page-head .lead { margin-bottom: 0; }
.crumb { font-size: 0.9rem; color: var(--slate); margin-bottom: 1.2rem; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.area { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(1.2rem, 4vw, 4rem); padding-block: clamp(1.6rem, 3vw, 2.6rem); border-top: 1px solid var(--line); }
.area:last-child { border-bottom: 1px solid var(--line); }
.area h3 { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.9rem); letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.area .icon-badge { margin-bottom: 0.9rem; }
.area p { color: var(--slate); }
.two-col-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem 2rem; }

.prose { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.prose h2 { font-size: 1.6rem; margin-top: 2.2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul { list-style: disc; padding-left: 1.3rem; margin-bottom: 1em; display: block; }
.prose li { margin-bottom: 0.4em; }
.prose p, .prose li { color: #3d5065; }

/* ---------- Forms / embeds ---------- */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.3rem, 3vw, 2.2rem); position: relative; }
.form-card::after { content: ""; position: absolute; right: -1px; top: -1px; width: 48px; height: 48px; background: var(--gold); border-top-right-radius: var(--radius-lg); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.embed-frame { width: 100%; min-height: 560px; border: 0; background: transparent; }
.embed-frame[hidden], .form-fallback[hidden] { display: none; }
.form-fallback { padding: 1rem 0; }
.form-fallback p { color: var(--slate); }
.fineprint { font-size: 0.85rem; color: var(--slate); margin-top: 1rem; margin-bottom: 0; }

.form-title { font-weight: 600; font-size: 1.22rem; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 0.5rem; }
.note-box { margin-top: 1.4rem; border-left: 3px solid var(--gold); padding: 0.4rem 0 0.4rem 1.1rem; color: var(--slate); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid rgba(247,245,240,.14); background: var(--navy-deep); color: var(--warm); padding-block: clamp(2.6rem, 5vw, 4rem) 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.4rem; }
.footer-brand img { height: 40px; width: auto; margin-bottom: 1rem; }
.footer-brand p { color: #c7d0d9; max-width: 30em; font-size: 0.97rem; }
.footer-title { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 0.9rem; }
.footer-links { display: grid; gap: 0.5rem; }
.footer-links a { text-decoration: none; color: #e6ebf0; font-size: 0.97rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-legal { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(247,245,240,.18); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem 2rem; font-size: 0.85rem; color: #c7d0d9; }
.footer-legal p { margin: 0; max-width: 56em; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .split, .cta-grid, .area { grid-template-columns: 1fr; }
  .hero::before { width: 90%; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 1.6rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .viz { max-width: 560px; }
}
@media (max-width: 860px) {
  .js .nav-toggle { display: inline-flex; align-items: center; gap: 0.5rem; background: transparent; border: 1.5px solid var(--navy); color: var(--navy); border-radius: 999px; padding: 0.5rem 0.95rem; font: 600 0.95rem var(--font-body); cursor: pointer; }
  .js .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--warm); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.4rem; flex-direction: column; align-items: stretch; gap: 1rem; display: none; }
  .js .nav.is-open { display: flex; }
  .js .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .js .nav-list a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .no-js .header-inner { flex-wrap: wrap; padding-block: 0.7rem; }
  .no-js .nav-list { flex-wrap: wrap; gap: 0.4rem 1.2rem; }
  .no-js .nav { flex-wrap: wrap; }
  .header-inner { position: relative; }
}
@media (min-width: 480px) { .hero h1 .nb { white-space: nowrap; } }
@media (max-width: 640px) {
  .hero::before, .page-head::after { display: none; }
  body { font-size: 1.02rem; }
  .grid-2, .grid-3, .grid-4, .pillars, .two-col-list { grid-template-columns: 1fr; }
  .brand-name { font-size: 1.02rem; }
  .brand img { height: 30px; }
  .footer-grid { grid-template-columns: 1fr; }
  .actions .btn, .cta-actions .btn { width: 100%; }
  .viz-legend { padding-right: 0; }
  .hero { padding-bottom: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card--link { transition: none; }
  .btn:hover, .card--link:hover { transform: none; }
}
@media print {
  .site-header, .site-footer, .cta-band, .skip-link { display: none; }
  body { background: #fff; }
}
/* Small phones: keep the logo text and Menu button from crowding each other */
@media (max-width: 420px) {
  .brand { gap: 0.5rem; }
  .brand img { height: 26px; }
  .brand-name { font-size: 0.88rem; }
  .js .nav-toggle { padding: 0.4rem 0.75rem; font-size: 0.9rem; gap: 0.4rem; flex: none; }
  .brand { min-width: 0; }
  .brand-name { white-space: normal; line-height: 1.1; }
}
@media (max-width: 340px) {
  .brand-name { font-size: 0.8rem; }
}
