/* KFI theme for the deck engine. Loaded after deck.css, so anything here wins.

   Values come from resources/KFI Design System/tokens/, which match the Penpot file
   "Master Plan v1" token for token (57 of 57, checked 19 Nov 2026).
   Brand rules kept here: square corners, flat surfaces, no gradients, Title Case headings,
   orange only for the 7px rule and one callout per slide, cyan only on dark slides,
   JetBrains Mono only for IDs, URLs and paths. */

@font-face { font-family:'Archivo'; font-weight:300; font-display:block; src:url('../fonts/archivo-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family:'Archivo'; font-weight:400; font-display:block; src:url('../fonts/archivo-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Archivo'; font-weight:700; font-display:block; src:url('../fonts/archivo-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family:'Archivo'; font-weight:800; font-display:block; src:url('../fonts/archivo-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-weight:400; font-display:block; src:url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-weight:500; font-display:block; src:url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --font:'Archivo','Helvetica Neue',Arial,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;

  /* Tokens the engine reads */
  --page:#FFFFFF;      --ink:#1E2945;        /* .is-page: content sheets */
  --band-deep:#141B30; --ink-dark:#FFFFFF;   /* .slide: cover and closing (navy 950) */
  --band-alt:#0047BA;                        /* .is-alt: section dividers (KFI blue) */
  --accent:#0047BA;                          /* progress bar, current-slide ring */
  --highlight:#FE4815;                       /* skipped marker */

  /* KFI palette */
  --blue:#0047BA; --blue-700:#003A99; --blue-100:#E1EAF8; --blue-50:#F0F4FB;
  --navy:#1E2945; --navy-950:#141B30;
  --cyan:#2EB4E8; --orange:#FE4815;
  --text:#333333; --muted:#636363; --slate:#7C859C;
  --border:#DADADA; --border-strong:#ADADAD; --alt:#FAFAFA; --muted-bg:#E3E6EA;
  --ok:#1E7D4F; --ok-bg:#DCF1E6; --warn:#B26A00; --warn-bg:#FFF0D6;

  /* Type: headings from the design-system scale, text sized up for a room */
  --fs-hero:96px; --fs-display:70px; --fs-h1:60px; --fs-h2:50px; --fs-h3:40px;
  --fs-h4:30px; --fs-h5:28px; --fs-lead:32px; --fs-body:26px; --fs-small:22px; --fs-label:15px;

  --sheets:'00';   /* each deck sets its sheet count: <html style="--sheets:'22'"> */
}

/* Dark slides mirror their data-mode onto <html>, so the progress bar stays visible */
[data-mode="navy"]   { --accent:#2EB4E8; }
[data-mode="onblue"] { --accent:#FFFFFF; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote, table { margin:0; }
/* Headings break into lines of even length, so a long title never leaves one word on its own. */
h1, h2, h3 { text-wrap:balance; }
ul, ol { padding:0; list-style:none; }
.slide { font-size:var(--fs-body); line-height:1.45; }
.slide.is-page { color:var(--text); }
.slide.is-page :is(h1, h2, h3, h4) { color:var(--navy); }

/* Slide head: Title Case heading over the signature orange rule */
.head { display:flex; flex-direction:column; gap:20px; }
.t { font-size:var(--fs-h2); line-height:1.1; font-weight:700; max-width:40ch; }
.rule { display:block; width:120px; height:7px; background:var(--orange); }
.lead { font-size:var(--fs-lead); line-height:1.45; font-weight:300; max-width:46ch; }
.label { font-size:var(--fs-label); line-height:1.2; font-weight:700; letter-spacing:.7px; text-transform:uppercase; color:var(--blue); }
.slide:not(.is-page) .label { color:var(--cyan); }
.mono { font-family:var(--mono); font-size:.86em; letter-spacing:0; }
.muted { color:var(--muted); }
.small { font-size:var(--fs-small); line-height:1.45; }
.h5 { font-size:var(--fs-h5); line-height:1.2; font-weight:700; color:var(--navy); }

/* Drawing-sheet title block, bottom right of every content sheet.
   The sheet number is a CSS counter, so it stays right on screen, in the overview and in print. */
#canvas, #overview { counter-reset:sheet; }
.slide { counter-increment:sheet; }
.tb { position:absolute; right:80px; bottom:44px; display:flex; border:1px solid var(--border-strong);
      font-size:13px; line-height:1; color:var(--slate); background:var(--page); }
.tb > span { padding:9px 12px; }
.tb > span + span { border-left:1px solid var(--border-strong); }
.tb__name { font-weight:700; letter-spacing:.7px; text-transform:uppercase; }
.tb__sheet { font-family:var(--mono); }
.tb__sheet::before { content:"Sheet " counter(sheet, decimal-leading-zero) " of " var(--sheets); }

/* Status badges: always words, colour only reinforces them */
.badge { display:inline-flex; align-items:center; gap:7px; padding:6px 10px; border-radius:3px;
         font-size:13px; line-height:1; font-weight:700; letter-spacing:.7px; text-transform:uppercase; white-space:nowrap; }
.badge svg { width:14px; height:14px; flex:none; }
.badge--built    { background:var(--ok-bg); color:var(--ok); }
.badge--progress { background:var(--blue-100); color:var(--blue-700); }
.badge--next     { background:var(--muted-bg); color:var(--navy); }
.badge--open     { background:var(--warn-bg); color:var(--warn); }

/* Screenshots: flat frame, caption in mono underneath */
.shot { display:flex; flex-direction:column; gap:10px; min-width:0; }
.shot__img { border:1px solid var(--border); background:var(--alt); overflow:hidden; }
.shot__img img { display:block; width:100%; height:100%; object-fit:cover; object-position:top left; }
.shot__cap { font-family:var(--mono); font-size:14px; line-height:1.3; color:var(--muted); }

/* Numbered keys, as on a drawing: a circled number that points at a part of a diagram */
.key { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%;
       border:2px solid var(--navy); color:var(--navy); font:700 15px/1 var(--font); flex:none; }
.keys { display:flex; flex-direction:column; gap:12px; }
.keys li { display:flex; gap:14px; align-items:center; font-size:var(--fs-small); line-height:1.3; }

/* Step chain: boxes joined by arrows, left to right */
.chain { display:flex; align-items:stretch; }
.chain > li { flex:1; position:relative; padding:20px 22px; border:2px solid var(--navy); background:var(--page);
              display:flex; flex-direction:column; gap:8px; min-width:0; }
.chain > li + li { margin-left:34px; }
.chain > li + li::before { content:""; position:absolute; left:-36px; top:50%; width:26px; height:2px; background:var(--navy); }
.chain > li + li::after  { content:""; position:absolute; left:-12px; top:calc(50% - 6px);
                           border:6px solid transparent; border-left:8px solid var(--navy); border-right:0; }
.chain__n { font:500 14px/1 var(--mono); color:var(--muted); }
.chain__t { font-size:var(--fs-h5); line-height:1.15; font-weight:700; color:var(--navy); }
.chain__d { font-size:var(--fs-small); line-height:1.35; }
.chain > li.is-key { border-color:var(--blue); background:var(--blue-50); }

/* Tables: header rule in KFI blue, hairline rows */
.tbl { border-collapse:collapse; width:100%; font-size:var(--fs-small); line-height:1.35; }
.tbl th { text-align:left; font-size:var(--fs-label); font-weight:700; letter-spacing:.7px; text-transform:uppercase;
          color:var(--muted); padding:0 28px 12px 0; border-bottom:2px solid var(--blue); }
.tbl td { padding:13px 28px 13px 0; border-bottom:1px solid var(--border); vertical-align:top; }
.tbl td:first-child { font-weight:700; color:var(--navy); }

/* Callout: the one orange accent a sheet may carry */
.callout { border-left:7px solid var(--orange); padding:6px 0 6px 22px; font-size:var(--fs-small); line-height:1.4; color:var(--navy); }
.callout b { font-weight:700; }

/* Section dividers: a sheet index for the part */
.index { display:flex; flex-direction:column; gap:14px; }
.index li { display:flex; gap:22px; align-items:baseline; font-size:var(--fs-lead); line-height:1.25; }
.index li .mono { font-size:20px; opacity:.75; min-width:3ch; }

/* Diagrams are inline SVG drawn against these classes */
.dg { display:block; overflow:visible; }
.dg text { font-family:var(--font); }
.dg .box   { fill:var(--page); stroke:var(--navy); stroke-width:2; }
.dg .box--p { fill:var(--blue-50); stroke:var(--blue); }
.dg .box--d { fill:var(--alt); stroke:var(--navy); }
.dg .box--l { fill:var(--page); stroke:var(--slate); stroke-dasharray:7 6; }
.dg .zone  { fill:none; stroke:var(--border-strong); stroke-width:1; stroke-dasharray:3 5; }
.dg .zl    { font-size:14px; font-weight:700; letter-spacing:.7px; fill:var(--slate); text-transform:uppercase; }
.dg .ln    { fill:none; stroke:var(--navy); stroke-width:2; }
.dg .ln--l { stroke:var(--slate); stroke-dasharray:7 6; }
.dg .ln--k { stroke:var(--orange); stroke-width:3; }
.dg .nm    { font-size:19px; font-weight:700; fill:var(--navy); }
.dg .pr    { font-family:var(--mono); font-size:13px; fill:var(--muted); }
.dg .kc    { fill:var(--page); stroke:var(--navy); stroke-width:2; }
.dg .kn    { font-size:14px; font-weight:700; fill:var(--navy); }
.dg .tx    { font-size:16px; fill:var(--text); }

/* Text on dark slides (the design system's dark theme values) */
:root { --on-dark:#D5DBE8; --on-dark-muted:#A3AEC8; }
.slide.is-alt .label { color:#FFFFFF; opacity:.85; }

/* Cover title block: the sheet set, its size, the date */
.ctb { display:flex; align-self:flex-start; border:1px solid rgb(255 255 255 / .3); }
.ctb > div { padding:14px 22px; display:flex; flex-direction:column; gap:8px; }
.ctb > div + div { border-left:1px solid rgb(255 255 255 / .3); }
.ctb .k { font-size:12px; line-height:1.2; font-weight:700; letter-spacing:.7px; text-transform:uppercase; color:var(--on-dark-muted); }
.ctb .v { font-size:var(--fs-small); line-height:1.2; font-weight:700; color:#FFFFFF; }

/* Facts: a navy rule over a short title and a sentence */
.fact { border-top:2px solid var(--navy); padding-top:18px; display:flex; flex-direction:column; gap:10px; min-width:0; }

/* Lists with a small square marker: square corners, like the rest of the brand */
.ticks { display:flex; flex-direction:column; gap:14px; }
.ticks li { position:relative; padding-left:26px; }
.ticks li::before { content:""; position:absolute; left:0; top:.55em; width:9px; height:9px; background:var(--blue); }
.slide:not(.is-page) .ticks li::before { background:var(--cyan); }

/* Two even columns, the most common sheet layout */
.cols { display:grid; grid-template-columns:1fr 1fr; gap:64px; align-items:start; }

/* Diagram extras: a description line on people boxes, and the arrowheads' colours live in each <marker> */
.dg .ds { font-size:14px; fill:var(--muted); }

/* Print: one 1600×900 page per slide. The engine's print rules keep #canvas at 900px with
   overflow hidden, which prints only the first slide; these two lines let every slide through. */
@media print {
  #canvas { height:auto; overflow:visible; }
  .slide { height:900px; }
}

/* Diagram containers: a product as a box of its parts */
.dg .cn { font-size:22px; font-weight:800; fill:var(--navy); }
.dg .box.row { fill:var(--alt); stroke:var(--border-strong); stroke-width:1; }
.dg .gl { font-size:15px; fill:var(--text); }

/* Diagram boundary: the line between KFI's own machines and the cloud */
.dg .bound { fill:none; stroke:var(--slate); stroke-width:2; stroke-dasharray:10 8; }

/* Icon tiles: a line icon on a square of KFI blue tint, to anchor list items */
.ico { flex:none; display:grid; place-items:center; width:44px; height:44px; background:var(--blue-100); color:var(--blue); }
.ico svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.ilist { display:flex; flex-direction:column; gap:12px; }
.ilist > li { display:flex; gap:16px; align-items:center; }
.ticks--names li::before { top:9px; }

/* KFI logo, top right of every content sheet; header badges stay clear of it. */
.slide.is-page::after { content:""; position:absolute; top:68px; right:80px; width:80px; height:80px; pointer-events:none;
                        background:url('../images/kfi-logo.svg') center / contain no-repeat; }
.slide.is-page > div:first-child > .badge { margin-right:112px; margin-top:15px; } /* centred on the title line, like the logo */

/* Diagram nodes light up under the pointer (deck.js sets .is-hover on [data-hover]). */
.dg [data-hover] > rect.box, .dg [data-hover] > use { transition:fill .15s ease, stroke .15s ease, color .15s ease, transform .15s ease; }
.dg [data-hover] > use { transform-box:fill-box; transform-origin:center; }
.dg [data-hover].is-hover > rect.box { fill:var(--blue-50) !important; stroke:var(--orange) !important; stroke-width:3 !important; }
.dg [data-hover].is-hover > use { color:var(--orange) !important; transform:scale(1.18); }

/* Components that light up under the pointer, like the diagram nodes. */
:root { --hover-targets: ".fact, .chain > li, .ilist > li, .seg label"; }
.fact, .chain > li, .ilist > li, .ilist .ico { transition:background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.fact.is-hover { border-top-color:var(--orange); background:var(--blue-100);
                 box-shadow:-14px 0 0 var(--blue-100), 14px 0 0 var(--blue-100), 0 14px 0 var(--blue-100),
                            -14px 14px 0 var(--blue-100), 14px 14px 0 var(--blue-100); }
.chain > li.is-hover { border-color:var(--orange); background:var(--blue-50); }
.ilist > li.is-hover { background:var(--blue-50); box-shadow:-10px 0 0 var(--blue-50), 10px 0 0 var(--blue-50); }
.ilist > li.is-hover .ico { background:var(--orange); color:#FFFFFF; }

/* A two-way switch on a slide: radio inputs and their labels. The slide reacts with :has(). */
.seg { display:inline-flex; border:1px solid var(--border-strong); background:var(--page); font-size:13px; line-height:1; }
.seg input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.seg label { padding:9px 14px; font-weight:700; letter-spacing:.7px; text-transform:uppercase; color:var(--slate); cursor:pointer;
             transition:background-color .15s ease, color .15s ease; }
.seg label + input + label { border-left:1px solid var(--border-strong); }
.seg label.is-hover { color:var(--navy); background:var(--blue-50); }
.seg input:checked + label { background:var(--navy); color:#FFFFFF; }
.seg input:focus-visible + label { outline:2px solid var(--blue); outline-offset:2px; }
