/* Kenya Debt Clock: the page chrome shared by every page in the new look (flag frame, LIVE ticker, header), with one
   set of sizes so it sits in exactly the same place on every page, and the page-turn transition between pages.
   Loaded last on every page (after navy.css on the home page, after navy-site.css on the others). */
:root { --kdc-pad: clamp(16px, 3.4vw, 56px); }
/* Every page reserves the scrollbar's space, scrolling or not, so the header never shifts sideways between pages. */
html { scrollbar-gutter: stable; }

/* Kenya's flag as the frame of the window. */
html body .w-flag { position: fixed; inset: 0; z-index: 300; pointer-events: none; display: block !important; background: none;
  box-shadow: inset 0 0 0 3px #000, inset 0 0 0 4px #fff, inset 0 0 0 7px #c8102e, inset 0 0 0 8px #fff, inset 0 0 0 11px #0f6b3c, inset 0 0 0 12px rgba(150, 205, 255, 0.35);
  view-transition-name: kdc-frame; }
html body .w-flag i { display: none; }

/* LIVE ticker: 38px, pinned just inside the top of the frame. */
html body .w-band { display: flex !important; position: sticky; top: 12px; z-index: 102; box-sizing: border-box; height: 38px; margin: 0; align-items: center; overflow: hidden;
  padding: 0 0 0 92px; background: #07111d; border: 0; border-bottom: 1px solid #33465c; view-transition-name: kdc-band; }
html body .w-band::before { content: "LIVE"; position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; display: flex; align-items: center; padding: 0 20px 0 30px; background: #c8102e; color: #fff; font: 800 14px/1 'Inter', sans-serif; letter-spacing: 0.08em; }
html body .w-band::after { content: ""; position: absolute; left: 18px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #fff; transform: translateY(-50%); z-index: 3; }
html body .w-band-track { display: flex; width: max-content; animation: kdcband 60s linear infinite; }
html body .w-band-track span { font: 600 13px/1 'Inter', sans-serif; letter-spacing: 0.02em; text-transform: uppercase; color: #fff; white-space: nowrap; display: flex; align-items: center; padding: 0; }
html body .w-band-track span::after { content: "\25c6"; color: #ef3e4a; font-size: 0.6em; margin: 0 1.6em; }
html body .w-band-track a { color: #fff; text-decoration: none; display: flex; align-items: center; }
html body .w-band-track a:hover span { color: #7cc4ff; text-decoration: underline; text-underline-offset: 3px; }
html body .w-band-track small { font: 600 10px/1 'IBM Plex Mono', monospace; letter-spacing: 0.04em; text-transform: none; color: #8fa1b7; margin-left: 8px; padding: 3px 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.3); }
html body .w-band:hover .w-band-track { animation-play-state: paused; }
@keyframes kdcband { to { transform: translateX(-50%); } }

/* Header: 52px, pinned under the ticker; identical on every page. */
html body header.w-head { display: flex !important; position: sticky !important; top: 50px !important; z-index: 100; box-sizing: border-box; height: 52px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 var(--kdc-pad) !important; gap: 22px; align-items: center; grid-template-columns: none; grid-template-rows: none;
  background: rgba(11, 26, 44, 0.96) !important; border: 0 !important; border-bottom: 1px solid #243950 !important; box-shadow: none !important; backdrop-filter: blur(10px);
  color: #d4dde8 !important; font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif !important; line-height: normal; view-transition-name: kdc-head; }
html body .w-head .w-mark { font: 800 20px/1 'Inter', sans-serif !important; letter-spacing: -0.035em; text-decoration: none; color: #f2f5f9 !important; white-space: nowrap; }
html body .w-head .w-mark b { color: #ef3e4a; font-weight: 800; }
html body .w-head .w-nav { display: flex; gap: 16px; margin: 0 0 0 auto; padding: 0; }
html body .w-head .w-nav a { font: 600 13.5px/1 'Inter', sans-serif !important; color: #d4dde8 !important; padding: 6px 0; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; background: none; }
html body .w-head .w-nav a:hover, html body .w-head .w-nav a.active { color: #fff !important; border-bottom-color: #ef3e4a; }
html body .w-head .w-live { display: flex; align-items: center; justify-content: center; gap: 9px; box-sizing: border-box; width: 252px; flex: none; margin: 0; padding: 0 12px; height: 28px;
  font: 500 11.5px/1 'IBM Plex Mono', monospace !important; color: #a9b8cb !important; white-space: nowrap; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03) 50%, rgba(0,0,0,.18)); box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.55); }
html body .w-head .w-live .w-fy { display: none; }
html body .w-head .w-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef3e4a; flex: none; animation: kdcpulse 1.6s infinite; }
@keyframes kdcpulse { 0% { box-shadow: 0 0 0 0 rgba(239, 62, 74, 0.7); } 70% { box-shadow: 0 0 0 9px rgba(239, 62, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 62, 74, 0); } }
html body .w-head .hamburger { display: none; padding: 9px 10px; cursor: pointer; border: 0; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.18)); box-shadow: inset 0 0 0 1px rgba(150, 205, 255, 0.55); }
html body .w-head .hamburger span { display: block; width: 18px; height: 2px; background: #f2f5f9; margin: 3px 0; }
@media (min-width: 1600px) { html body .w-head .w-live { width: 452px; } html body .w-head .w-live .w-fy { display: inline; border-left: 1px solid #33465c; padding-left: 9px; } }
@media (max-width: 1100px) { html body .w-head .w-nav { display: none; } html body .w-head .hamburger { display: block; } html body .w-head .w-live { margin-left: auto; } }
@media (max-width: 600px) { html body header.w-head { padding: 0 16px !important; gap: 10px; } html body .w-head .w-mark { font-size: 18px !important; }
  html body .w-head .w-live { width: auto; } html body .w-head .w-live #liveDateTime, html body .w-head .w-live .w-time { display: none; } }

/* Page turn between pages (Chrome, Edge, Safari): the frame, ticker and header stay perfectly still; the old page
   turns away to the left like a book page, showing the new page beneath it. Off for people who turn motion down. */
@view-transition { navigation: auto; }
::view-transition-group(kdc-frame), ::view-transition-group(kdc-band), ::view-transition-group(kdc-head) { animation: none; }
::view-transition-old(kdc-frame), ::view-transition-old(kdc-band), ::view-transition-old(kdc-head) { display: none; }
::view-transition-new(kdc-frame), ::view-transition-new(kdc-band), ::view-transition-new(kdc-head) { animation: none; }
::view-transition-image-pair(root) { isolation: auto; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 2; transform-origin: 0% 50%; animation: kdc-turn 0.7s cubic-bezier(0.55, 0.05, 0.25, 1) both; }
::view-transition-new(root) { z-index: 1; animation: kdc-under 0.7s ease both; }
@keyframes kdc-turn {
  0%   { transform: perspective(2400px) rotateY(0deg); filter: brightness(1); }
  100% { transform: perspective(2400px) rotateY(-96deg); filter: brightness(0.45); }
}
@keyframes kdc-under { from { filter: brightness(0.75); } to { filter: brightness(1); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } html body .w-band-track, html body .w-head .w-dot { animation: none; } }

/* Home page in one-screen mode: its body is the scrolling box, so the pinned offsets count from inside the frame's
   12px padding. Offsets are reduced by 12px there so the ticker and header land exactly where they do on other pages. */
@media (min-width: 1024px) and (min-height: 620px) {
  html body.wow .w-band { top: 0; }
  html body.wow header.w-head { top: 38px !important; }
}

/* Header pill: just the Nairobi date and time, centred (the word "Live" and the pulsing dot are on the ticker only). */
html body .w-head .w-live { width: 222px; }
html body .w-head .w-live .w-dot { display: none; }
@media (min-width: 1600px) { html body .w-head .w-live { width: 420px; } }

/* Bottom bar, the same on every page: sources on the left, the look switch in the middle, the updated note on the right.
   Pinned just inside the bottom of the frame (on the one-screen home page it simply ends the page). */
html body footer.w-foot { display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; box-sizing: border-box;
  margin: 0; padding: 8px var(--kdc-pad) !important; min-height: 40px; background: rgba(7, 17, 29, 0.96) !important; border: 0 !important;
  border-top: 1px solid #33465c !important; color: #a9b8cb !important; font: 500 12px/1.5 'IBM Plex Mono', monospace !important; backdrop-filter: blur(8px); z-index: 55; }
html body:not(.wow) footer.w-foot { position: sticky !important; bottom: 12px; }
html body footer.w-foot .w-sources { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: #a9b8cb; }
html body footer.w-foot .w-sources a { color: #d4dde8 !important; text-decoration: none; }
html body footer.w-foot .w-sources a:hover { color: #fff !important; }
html body footer.w-foot .w-foot-note { margin: 0; text-align: right; font-size: 11.5px; color: #a9b8cb; }
html body footer.w-foot .w-fresh { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2fb36b; vertical-align: middle; }
html body footer.w-foot .kdc-switch-slot { display: flex; justify-content: center; }
@media (max-width: 900px) { html body footer.w-foot { grid-template-columns: 1fr; text-align: center; } html body footer.w-foot .w-sources { justify-content: center; } html body footer.w-foot .w-foot-note { text-align: center; } }

/* The LIVE label on the ticker flashes, as it did before: the white dot blinks with a soft pulse. */
html body .w-band::after { animation: kdclive 1.2s ease-in-out infinite; }
@keyframes kdclive {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.75); }
  50% { opacity: 0.2; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) { html body .w-band::after { animation: none; } }

/* Bottom bar text in one font on every page (the inner pages' font file would otherwise switch the links to Inter). */
html body footer.w-foot .w-sources, html body footer.w-foot .w-sources a, html body footer.w-foot .w-foot-note, html body footer.w-foot .w-foot-note span { font-family: 'IBM Plex Mono', monospace !important; }

/* LIVE as a small pill, the same size as the ticker text, with the flashing dot inside. The figures run the full width
   and fade out just before the pill, so they slip underneath it instead of meeting a block. */
html body .w-band { padding-left: 0; }
html body .w-band::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 132px; padding: 0; z-index: 2;
  background: linear-gradient(90deg, #07111d 0, #07111d 84px, rgba(7, 17, 29, 0) 132px); font-size: 0; }
html body .w-band::after { display: none; }
html body .w-live-pill { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 7px;
  height: 22px; padding: 0 10px 0 9px; border-radius: 999px; background: #c8102e; color: #fff; font: 700 13px/1 'Inter', sans-serif !important; letter-spacing: 0.06em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 10px -2px rgba(200, 16, 46, 0.6); }
html body .w-live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex: none; animation: kdclive 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { html body .w-live-pill i { animation: none; } }

/* The figures fade in at the right the same way they fade out under the LIVE pill on the left (mirror-image fades), so
   the ticker reads as one continuous loop. */
html body .w-band::after { display: block; content: ""; position: absolute; right: 0; left: auto; top: 0; bottom: 0; width: 132px; height: auto; border-radius: 0;
  transform: none; z-index: 2; animation: none; box-shadow: none; background: linear-gradient(270deg, #07111d 0, #07111d 84px, rgba(7, 17, 29, 0) 132px); }

/* Smoky flag frame: the same bands in the same order (black, white, red, white, green), softened with a light blur so
   they melt into each other, with a faint green haze and a trace of red drifting inward and fading into the page. */
html body .w-flag {
  box-shadow:
    inset 0 0 0 3px #000,
    inset 0 0 0 4px rgba(255, 255, 255, 0.9),
    inset 0 0 0 7px #c8102e,
    inset 0 0 0 8px rgba(255, 255, 255, 0.9),
    inset 0 0 0 11px #0f6b3c,
    inset 0 0 22px 10px rgba(15, 107, 60, 0.42),
    inset 0 0 46px 14px rgba(200, 16, 46, 0.10);
  filter: blur(1.4px);
}
/* Smoky frame, tuned so all five bands stay visible: slightly wider bands and a lighter blur. */
html body .w-flag {
  box-shadow:
    inset 0 0 0 4px #000,
    inset 0 0 0 6px rgba(255, 255, 255, 0.95),
    inset 0 0 0 9px #c8102e,
    inset 0 0 0 11px rgba(255, 255, 255, 0.95),
    inset 0 0 0 14px #0f6b3c,
    inset 0 0 20px 12px rgba(15, 107, 60, 0.38),
    inset 0 0 44px 16px rgba(200, 16, 46, 0.09);
  filter: blur(0.7px);
}

/* Phones: the date is hidden, so the whole date pill goes too (it was left as an empty outlined pill). */
@media (max-width: 600px) { html body .w-head .w-live { display: none !important; } html body .w-head .hamburger { margin-left: auto; } }

/* Phones: the bottom bar stacks into three rows (about 150px), so it is no longer pinned over the content; it ends the page instead. */
@media (max-width: 600px) { html body:not(.wow) footer.w-foot { position: static !important; gap: 8px; } }

/* Phones: the flag frame stays pinned and never moves. It is sized to the full-screen height (address bar hidden,
   100lvh) instead of the visible height, which changes as the address bar slides in and out and made the frame stretch
   and jump while scrolling. While the address bar shows, the bottom edge sits just below the screen. The ticker and
   header stick to the very top, so nothing shows above them. */
@media (max-width: 600px) {
  html body .w-flag { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: auto !important;
    height: 100vh !important; height: 100lvh !important; }
  html body .w-band { top: 0 !important; }
  html body header.w-head { top: 38px !important; }
}
