/* ==========================================================================
   JIFFYAI CFO — Capability overview
   Document treatment: dark ground, light type, gold rules (dark theme everywhere). Twenty-one pages,
   a sticky contents rail, and a print stylesheet that maps one page per sheet.
   ========================================================================== */
:root {
  --paper: #0B0B0D; --paper-2: #101013; --sheet: #17171C; --sheet-2: #1E1E26; --rule: rgba(255,255,255,.1); --rule-2: rgba(255,255,255,.18);
  --ink: #F5F4F0; --ink-2: #D6D4CC; --muted: #A8A8B3; --dim: #7A7A86;
  --gold: #CFA14C; --gold-2: #E2BC6C; --gold-deep: #E2BC6C; --gold-pale: rgba(207,161,76,.14);
  --green: #3DBB7A; --red: #E0605B;
  --sans: "IBM Plex Sans", Inter, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: Sora, "IBM Plex Sans", Inter, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --top-h: 60px; --rail-w: 280px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); display: block; }

/* ---------- Top bar ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); background: rgba(11,11,13,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); z-index: 50; display: flex; align-items: center; gap: 16px; padding: 0 22px; }
.top__logo { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.top__logo .mark { width: 26px; height: 26px; border-radius: 7px; background: conic-gradient(from 210deg, var(--gold-deep), #F1D89A, var(--gold-deep)); color: #000; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.top__logo .sub { color: var(--gold-deep); }
.top__title { font-size: 14px; color: var(--muted); padding-left: 16px; border-left: 1px solid var(--rule); }
.top__title b { color: var(--ink); font-weight: 600; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top__count { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-right: 8px; }
.tbtn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--rule-2); font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--sheet-2); transition: all .25s; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tbtn:hover { border-color: var(--gold); color: var(--gold-deep); }
.tbtn--primary { background: var(--gold); color: #141414; border-color: var(--gold); } .tbtn--primary:hover { background: var(--gold-2); color: #141414; }
.top__progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--gold); transition: width .3s; }

/* ---------- Layout ---------- */
.doc { display: grid; grid-template-columns: var(--rail-w) 1fr; gap: 0; padding-top: var(--top-h); min-height: 100vh; }
.rail { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 28px 18px 28px 22px; border-right: 1px solid var(--rule); background: var(--paper); }
.rail .kicker { margin-bottom: 14px; }
.rail__list { display: grid; gap: 2px; }
.rail__item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); transition: all .25s; position: relative; }
.rail__item:hover { background: var(--sheet); color: var(--ink); }
.rail__item.is-active { background: var(--sheet-2); color: var(--ink); font-weight: 600; }
.rail__item.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--gold); border-radius: 2px; }
.rail__item i { font-family: var(--mono); font-size: 10.5px; color: var(--dim); font-style: normal; }
.rail__item.is-active i { color: var(--gold-deep); }
.rail__sec { margin: 16px 0 6px; padding: 0 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.rail__sec:first-of-type { margin-top: 0; }
.rail__search { display: block; margin: 0 0 10px; }
.rail__search input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink); font: inherit; font-size: 13px; }
.rail__search input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.rail__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rail__chips button { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule-2); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--sheet); min-height: 30px; }
.rail__chips button[aria-pressed="true"] { background: var(--gold); color: #141414; border-color: var(--gold); }
.rail__empty { font-size: 12.5px; color: var(--muted); padding: 8px 10px; }
.rail__item[hidden] { display: none; }
.page--dim { opacity: .28; }
.page--dim.is-active { opacity: .6; }
.page__related { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.page__related a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--rule); background: var(--sheet-2); color: var(--ink); font-weight: 500; min-height: 32px; }
.page__related a:hover { border-color: var(--gold); color: var(--gold-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rail__foot { margin-top: 24px; padding: 14px; border-radius: 10px; background: var(--gold-pale); font-size: 12.5px; color: var(--ink-2); }
.rail__foot b { display: block; font-weight: 600; margin-bottom: 4px; }

/* ---------- Pages ---------- */
.pages { padding: 40px clamp(20px, 4vw, 64px) 80px; display: grid; gap: 34px; }
.page {
  position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 24px 60px -30px rgba(0,0,0,.45);
  min-height: clamp(520px, 58vw, 720px); width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(28px, 4vw, 56px) clamp(28px, 4.5vw, 64px) 24px; display: flex; flex-direction: column;
  scroll-margin-top: calc(var(--top-h) + 30px); overflow: visible;
  opacity: .55; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease), box-shadow .5s;
}
.page.is-in { opacity: 1; transform: none; }
.page.is-active { box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 30px 70px -30px rgba(0,0,0,.55), 0 0 0 1px var(--gold); }
.page__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(12px, 1.8vw, 24px); }
.page__head .kicker { color: var(--gold-deep); }
.page__head span:last-child { font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: .1em; }
.page h2 { font-size: clamp(1.4rem, 2.3vw, 2.2rem); max-width: 26ch; margin-bottom: clamp(14px, 2vw, 24px); }
.page__foot { margin-top: 28px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: .08em; border-top: 1px solid var(--rule); padding-top: 12px; }
.page__foot b { color: var(--gold-deep); font-weight: 500; }
.page__body { flex: 1; }
.page--dark { background: #1E1E26; color: #F5F4F0; border-color: rgba(207,161,76,.35); }
.page--dark .page__foot { border-color: #2a2a33; color: #74747f; } .page--dark .page__head span:last-child { color: #74747f; }
.page--dark .kicker { color: var(--gold-2); }
.page--gold { background: linear-gradient(160deg, #CFA14C, #B98F2E); color: #15151A; border-color: #B98F2E; }
.page--gold .kicker { color: rgba(0,0,0,.6); } .page--gold .page__foot { border-color: rgba(0,0,0,.25); color: rgba(0,0,0,.6); } .page--gold .page__foot b { color: #15151A; }

/* title page */
.title { justify-content: flex-end; min-height: clamp(520px, 62vw, 760px); }
.title__logo { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .05em; position: absolute; top: clamp(28px, 4vw, 56px); left: clamp(28px, 4.5vw, 64px); }
.title__logo .mark { width: 36px; height: 36px; border-radius: 10px; background: conic-gradient(from 210deg, var(--gold-deep), #F1D89A, var(--gold-deep)); color: #000; display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.title__logo .sub { color: var(--gold-2); }
.title h1 { font-size: clamp(2.2rem, 4.6vw, 4.2rem); letter-spacing: -.03em; max-width: 16ch; margin: 18px 0 22px; }
.title__lede { color: #A8A8B3; font-size: clamp(1rem, 1.5vw, 1.25rem); max-width: 56ch; }
.title__meta { margin-top: clamp(24px, 4vw, 48px); display: flex; gap: 28px; font-family: var(--mono); font-size: 11.5px; color: #74747f; letter-spacing: .1em; }
.title__meta b { color: var(--gold-2); font-weight: 500; }

/* contents */
.toc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; counter-reset: c; }
.toc li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.toc li i { font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--gold); font-style: normal; line-height: 1; }
.toc li b { display: block; font-weight: 600; font-size: 1.05rem; } .toc li span { color: var(--muted); font-size: 14px; }
.toc a:hover b { color: var(--gold-deep); }
.note { margin-top: 22px; padding-top: 16px; color: var(--dim); font-size: 13px; }

/* generic */
.cols { display: grid; gap: 18px; } .cols--2 { grid-template-columns: 1fr 1fr; } .cols--3 { grid-template-columns: repeat(3, 1fr); } .cols--4 { grid-template-columns: repeat(4, 1fr); } .cols--5 { grid-template-columns: repeat(5, 1fr); }
.box { border: 1px solid var(--rule); border-radius: 10px; padding: clamp(14px, 1.8vw, 22px); background: var(--sheet-2); }
.box .kicker { margin-bottom: 8px; }
.box h3 { font-size: clamp(.98rem, 1.3vw, 1.15rem); margin-bottom: 8px; }
.box p { color: var(--muted); font-size: clamp(.82rem, 1.05vw, 14.5px); }
.box .n { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 2.4vw, 2.2rem); color: var(--gold); line-height: 1; margin-bottom: 10px; }
.box--tint { background: var(--gold-pale); border-color: #E7D9A8; }
.page--dark .box { background: #17171d; border-color: #2a2a33; } .page--dark .box p { color: #A8A8B3; }
.lede { color: var(--muted); font-size: clamp(.95rem, 1.25vw, 1.1rem); max-width: 60ch; }
.bar-line { margin-top: 22px; padding: 14px 18px; border-left: 3px solid var(--gold); background: var(--paper); font-size: clamp(.9rem, 1.15vw, 1rem); color: var(--ink-2); border-radius: 0 8px 8px 0; }
.bar-line b { font-weight: 600; color: var(--ink); }
.page--dark .bar-line { background: #24242E; color: #F5F4F0; } .page--dark .bar-line b { color: var(--gold-2); }
.lines li { padding: 9px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: clamp(.86rem, 1.1vw, 15px); }
.lines li .m { font-family: var(--mono); font-size: 12px; } .lines--old .m { color: var(--dim); } .lines--new .m { color: var(--gold); } .lines--new li { font-weight: 500; }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-row div { min-width: 120px; } .stat-row b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.4vw, 2.2rem); color: var(--gold); line-height: 1; letter-spacing: -.02em; } .stat-row span { font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(20px, 3vw, 44px); align-items: start; }
.agents li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.agents li i { width: 26px; height: 26px; border-radius: 7px; background: var(--gold-pale); color: var(--gold-deep); font-family: var(--mono); font-size: 10px; display: grid; place-items: center; font-style: normal; }
.agents b { display: block; font-weight: 600; font-size: clamp(.9rem, 1.15vw, 1rem); } .agents span { color: var(--muted); font-size: clamp(.82rem, 1.05vw, 14px); }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.stages span { font-family: var(--mono); font-size: 10.5px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--rule); background: var(--sheet-2); color: var(--muted); display: flex; gap: 8px; }
.stages span i { color: var(--gold); font-style: normal; } .stages span.you { background: var(--gold); color: #141414; border-color: var(--gold); } .stages span.you i { color: var(--gold-2); }
.list3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.list3 h4 { font-size: clamp(.9rem, 1.15vw, 1rem); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); display: inline-block; }
.list3 li { font-size: clamp(.78rem, 1vw, 13.5px); color: var(--ink-2); padding: 5px 0; border-top: 1px dashed var(--rule); }
.qs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
.qs h4 { font-size: 1rem; margin-bottom: 6px; color: var(--gold-deep); }
.qs li { font-size: clamp(.82rem, 1.05vw, 14.5px); padding: 6px 0 6px 18px; position: relative; color: var(--ink-2); }
.qs li::before { content: "◆"; position: absolute; left: 0; top: 7px; font-size: 9px; color: var(--gold); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; position: relative; }
.steps .box { padding-top: 54px; position: relative; }
.steps .box i { position: absolute; top: 16px; left: 18px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; color: var(--gold-deep); font-style: normal; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.result { border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result .kicker { grid-column: 1 / -1; margin-bottom: 2px; }
.result b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2.2vw, 2rem); color: var(--gold); line-height: 1; letter-spacing: -.02em; }
.result span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.result p { grid-column: 1 / -1; color: var(--muted); font-size: clamp(.8rem, 1vw, 13.5px); border-top: 1px solid var(--rule); padding-top: 8px; }
.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cert { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.cert b { display: block; font-weight: 600; font-size: .98rem; } .cert i { display: inline-block; font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--green); letter-spacing: .1em; text-transform: uppercase; margin: 4px 0 6px; } .cert p { color: var(--muted); font-size: 13px; }
.sessions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.sessions div { background: rgba(0,0,0,.1); border: 1px solid rgba(0,0,0,.2); border-radius: 10px; padding: 16px 18px; }
.sessions b { display: block; font-weight: 700; margin-bottom: 4px; } .sessions p { font-size: 14px; opacity: .8; }

/* ---------- Mobile ---------- */
.rail-toggle { display: none; }
@media (max-width: 1000px) {
  .doc { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: var(--top-h); bottom: 0; width: min(320px, 90vw); transform: translateX(-100%); transition: transform .4s var(--ease); z-index: 45; box-shadow: 0 0 60px rgba(0,0,0,.2); }
  .rail.is-open { transform: none; }
  .rail-toggle { display: inline-flex; }
  .page { padding-bottom: 24px; }
  .cols--3, .cols--4, .cols--5, .list3, .certs, .steps, .stages { grid-template-columns: 1fr 1fr; }
  .two, .cols--2, .toc, .qs, .results, .sessions { grid-template-columns: 1fr; }
  .top__title { display: none; }
}
@media (max-width: 600px) { .cols--3, .cols--4, .cols--5, .list3, .certs, .steps, .stages { grid-template-columns: 1fr; } .top__count { display: none; } }

/* ---------- Print ---------- */
@media print {
  @page { size: landscape; margin: 0; }
  body { background: var(--sheet-2); }
  .top, .rail, .rail-toggle { display: none !important; }
  .doc { display: block; padding: 0; }
  .pages { padding: 0; gap: 0; display: block; }
  .page { opacity: 1 !important; transform: none !important; box-shadow: none; border: 0; border-radius: 0; max-width: none; width: 100vw; min-height: 100vh; page-break-after: always; break-after: page; break-inside: avoid; margin: 0; }
  .page--dark, .page--gold { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ---------- Rebrand: JiffyFinOps.ai logo ---------- */
.mark { background: none !important; box-shadow: none; overflow: hidden; padding: 0; }
.mark svg { width: 100%; height: 100%; display: block; }
.word { white-space: nowrap; }
.word b { color: var(--gold); font-weight: 700; }
.word i { font-style: normal; font-weight: 500; font-size: .76em; opacity: .6; margin-left: 2px; }


/* ---------- Sparkle mark ---------- */
.mark { background: none !important; box-shadow: none; border-radius: 0; overflow: visible; }

/* ---------- responsive toolbar (final polish) ---------- */
.top { flex-wrap: nowrap; }
.tbtn { min-height: 36px; }
.top__logo { min-height: 36px; }
@media (max-width: 1100px) { .top__title { display: none; } }
@media (max-width: 760px) { .top__right { gap: 6px; } .tbtn { padding: 8px 10px; } a.tbtn[href="deck.html"] { display: none; } }
@media (max-width: 520px) { .top { padding: 0 12px; gap: 10px; } .top__logo .sub { display: none; } #print { display: none; } .top__count { display: none; } .rail-toggle { padding: 8px 10px; } }
@media (max-width: 400px) { .top__logo span:not(.mark) { display: none; } }
/* pages must shrink with the viewport — never size the column to max-content */
.pages { grid-template-columns: minmax(0, 1fr); }
.page { min-width: 0; }
.cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rail__chips button { min-height: 34px; }
@media (max-width: 1000px) { .doc { grid-template-columns: minmax(0, 1fr); } .cols--3, .cols--4, .cols--5, .list3, .certs, .steps, .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cols--3, .cols--4, .cols--5, .list3, .certs, .steps, .stages, .cols--2 { grid-template-columns: minmax(0, 1fr); } }
/* stage strips wrap instead of overflowing on narrow screens */
.stages { flex-wrap: wrap; }
.stages span { white-space: normal; }
@media (max-width: 1000px) { .stages { display: flex; flex-wrap: wrap; } .stages span { flex: 1 1 140px; } }
.rail__foot a { display: inline-block; padding: 6px 4px; margin: -6px -4px; min-height: 32px; line-height: 20px; }
.stages { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.title__meta { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 1280px) { .stages { display: flex; flex-wrap: wrap; } .stages span { flex: 1 1 120px; } }

/* JIFFYAI logo lockup (image + product tag) */
.jlogo { height: 20px; width: auto; display: block; flex-shrink: 0; }
.title__logo .jlogo, .hook__logo .jlogo { height: 36px; }
.app__top .jlogo { height: 16px; }
.jlogo + .word { padding-left: 9px; border-left: 1px solid rgba(255,255,255,.18); letter-spacing: 0; }
/* "FinOps" tag set at the same cap height as the JIFFYAI wordmark (wordmark caps ≈ 60% of image height; Sora caps ≈ .73em) */
.jlogo + .word { font-size: 16.6px; line-height: 1; }
.title__logo .jlogo + .word, .hook__logo .jlogo + .word { font-size: 30px; }
.app__top .jlogo + .word { font-size: 13.3px; }
@media (max-width: 640px) { .bar__logo .jlogo + .word { display: none; } }

/* phone: keep the cover copy clear of the absolutely positioned logo */
@media (max-width: 760px) { .title { padding-top: 120px; } }
@media (max-width: 400px) { .title__logo .jlogo { height: 28px; } .title__logo .jlogo + .word { font-size: 23px; } }
