/* ==========================================================================
   The Kind Card — design system ("kc")
   Colours stay on brand; type, shape and motion are new.
   Fonts: Bricolage Grotesque (display) + Rubik (text, includes Hebrew).
   Token names (--primary, --accent… as "R G B" triplets) are kept so admin.css
   and world-map.css keep working.
   ========================================================================== */

:root {
  /* Brand colours (R G B) */
  --primary: 33 75 165;        /* #214ba5 */
  --primary-dark: 22 45 120;   /* #162d78 */
  --blue-700: 22 45 120;
  --blue-900: 15 23 55;        /* #0f1737 ink */
  --info: 24 111 174;          /* #186fae */
  --blue-100: 231 239 252;
  --accent: 255 142 0;         /* #ff8e00 */
  --accent-secondary: 255 179 71; /* #ffb347 */
  --orange-700: 214 92 0;
  --orange-100: 255 237 214;
  --accent-text: 181 74 0;     /* orange that passes contrast on white */
  --on-accent: 15 23 55;       /* ink text on orange */
  --success: 22 163 74;
  --danger: 220 38 38;
  --heart: 225 29 72;

  --background: 255 255 255;
  --background-secondary: 255 248 239; /* cream */
  --background-tertiary: 253 239 222;
  --text-primary: 15 23 55;
  --text-secondary: 74 82 110;
  --text-muted: 140 146 166;
  --border-color: 232 226 216;

  --font-display: 'Bricolage Grotesque', 'Rubik', system-ui, sans-serif;
  --font-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15,23,55,.06), 0 2px 8px rgba(15,23,55,.05);
  --shadow: 0 10px 30px -10px rgba(15,23,55,.18), 0 4px 10px rgba(15,23,55,.05);
  --shadow-lg: 0 30px 60px -20px rgba(15,23,55,.35), 0 10px 20px rgba(15,23,55,.08);
  --shadow-glow-orange: 0 14px 34px -8px rgba(255,142,0,.55);
  --shadow-glow-blue: 0 14px 34px -8px rgba(33,75,165,.45);

  --grad-brand: linear-gradient(135deg, #162d78 0%, #214ba5 55%, #186fae 100%);
  --grad-night: radial-gradient(1200px 600px at 80% -10%, #2a5bc4 0%, rgba(42,91,196,0) 60%), radial-gradient(900px 500px at -10% 110%, #186fae 0%, rgba(24,111,174,0) 55%), #0f1737;
  --grad-accent: linear-gradient(135deg, #ff8e00 0%, #ffb347 100%);
  --grad-accent-deep: linear-gradient(135deg, #f07c00 0%, #ff9f2e 100%);
  --gradient-primary: var(--grad-brand);

  --nav-h: 76px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: var(--font-body);
  color: rgb(var(--text-primary));
  background: rgb(var(--background-secondary));
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
@supports not (overflow-x: clip) { body { overflow-x: hidden; } }
h1, h2, h3, h4, h5, h6, .kc-display, .kc-h1, .kc-h2, .kc-h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: inherit;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .kc-display, [dir="rtl"] .kc-h1, [dir="rtl"] .kc-h2 { letter-spacing: 0; line-height: 1.15; }
a { color: rgb(var(--primary)); text-underline-offset: .2em; }
a:hover { color: rgb(var(--blue-900)); }
img, video, iframe { max-width: 100%; }
::selection { background: rgb(var(--accent-secondary)); color: rgb(var(--blue-900)); }
:focus-visible { outline: 3px solid rgb(var(--accent)); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; top: .5rem; inset-inline-start: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: var(--radius-full); }
main { display: block; }
html.i18n-pending body { visibility: hidden; }

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.kc-display { font-size: clamp(2.75rem, 8.5vw, 6.25rem); line-height: .95; letter-spacing: -0.045em; }
.kc-h1 { font-size: clamp(2.25rem, 6vw, 4.25rem); }
.kc-h2 { font-size: clamp(1.9rem, 4.6vw, 3.25rem); }
.kc-h3 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); letter-spacing: -0.015em; }
.kc-lead { font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.55; color: rgb(var(--text-secondary)); max-width: 40rem; }
.kc-on-dark .kc-lead, .kc-lead.on-dark { color: rgba(255,255,255,.82); }
.kc-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgb(var(--accent-text));
}
[dir="rtl"] .kc-eyebrow { letter-spacing: 0; }
.kc-on-dark .kc-eyebrow { color: rgb(var(--accent-secondary)); }
.kc-eyebrow::before { content: ''; width: 22px; height: 3px; border-radius: 3px; background: currentColor; }

/* Orange highlighter behind words */
.kc-mark {
  position: relative; white-space: nowrap; z-index: 0;
  background: linear-gradient(transparent 58%, rgba(255,142,0,.55) 58%, rgba(255,179,71,.55) 92%, transparent 92%);
  padding: 0 .08em;
}
.kc-on-dark .kc-mark { background: linear-gradient(transparent 60%, rgba(255,142,0,.75) 60%, rgba(255,142,0,.75) 90%, transparent 90%); }
/* Hand-drawn underline (add an inline SVG with class kc-squiggle after the word) */
.kc-underline { position: relative; display: inline-block; }
.kc-squiggle { position: absolute; left: 0; right: 0; bottom: -.18em; width: 100%; height: .35em; color: rgb(var(--accent)); overflow: visible; }
.kc-squiggle path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: kcDraw 1.2s .4s var(--ease-out) forwards; }
@keyframes kcDraw { to { stroke-dashoffset: 0; } }
.kc-text-accent { color: rgb(var(--accent)); }
.kc-text-ink { color: rgb(var(--blue-900)); }

/* --------------------------------------------------------------------------
   Buttons (pill, bold, springy)
   -------------------------------------------------------------------------- */
.kc-btn {
  --kc-btn-bg: rgb(var(--blue-900));
  --kc-btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.5rem;
  border: 2px solid transparent; border-radius: var(--radius-full);
  background: var(--kc-btn-bg); color: var(--kc-btn-fg);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.kc-btn:hover { color: var(--kc-btn-fg); transform: translateY(-2px); }
.kc-btn:active { transform: translateY(0) scale(.98); }
.kc-btn i, .kc-btn .kc-btn-arrow { transition: transform .25s var(--ease-out); }
.kc-btn:hover .kc-btn-arrow { transform: translateX(4px); }
[dir="rtl"] .kc-btn-arrow { transform: scaleX(-1); }
[dir="rtl"] .kc-btn:hover .kc-btn-arrow { transform: scaleX(-1) translateX(4px); }
.kc-btn--primary { --kc-btn-bg: var(--grad-accent); --kc-btn-fg: rgb(var(--blue-900)); background: var(--grad-accent); box-shadow: var(--shadow-glow-orange); }
.kc-btn--primary:hover { background: var(--grad-accent-deep); box-shadow: 0 18px 38px -8px rgba(255,142,0,.65); }
.kc-btn--navy { --kc-btn-bg: rgb(var(--primary)); background: rgb(var(--primary)); box-shadow: var(--shadow-glow-blue); }
.kc-btn--navy:hover { background: rgb(var(--blue-900)); }
.kc-btn--ghost { --kc-btn-bg: transparent; --kc-btn-fg: rgb(var(--blue-900)); border-color: rgba(15,23,55,.18); }
.kc-btn--ghost:hover { border-color: rgb(var(--blue-900)); background: rgba(15,23,55,.04); }
.kc-on-dark .kc-btn--ghost, .kc-btn--ghost.on-dark { --kc-btn-fg: #fff; border-color: rgba(255,255,255,.35); }
.kc-on-dark .kc-btn--ghost:hover, .kc-btn--ghost.on-dark:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.kc-btn--light { --kc-btn-bg: #fff; --kc-btn-fg: rgb(var(--blue-900)); background: #fff; box-shadow: var(--shadow); }
.kc-btn--lg { min-height: 58px; padding: 1rem 1.9rem; font-size: 1.1rem; }
.kc-btn--sm { min-height: 38px; padding: .45rem 1rem; font-size: .9rem; }
.kc-btn--block { width: 100%; }
.kc-btn:disabled, .kc-btn[aria-busy="true"] { opacity: .65; pointer-events: none; }
/* Bootstrap/legacy buttons restyled to match (used by shared partials) */
.btn { border-radius: var(--radius-full); font-weight: 700; }
.btn-kind, .btn-kind-solid, .btn-kind-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--radius-full); font-weight: 700; border: 2px solid transparent;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease, background .2s ease;
}
.btn-kind { background: var(--grad-accent); color: rgb(var(--blue-900)); box-shadow: var(--shadow-glow-orange); }
.btn-kind:hover, .btn-kind:focus-visible { background: var(--grad-accent-deep); color: rgb(var(--blue-900)); transform: translateY(-2px); }
.btn-kind-solid { background: rgb(var(--primary)); color: #fff; }
.btn-kind-solid:hover { background: rgb(var(--blue-900)); color: #fff; transform: translateY(-2px); }
.btn-kind-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-kind-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.btn-primary { --bs-btn-bg: rgb(var(--primary)); --bs-btn-border-color: rgb(var(--primary)); --bs-btn-hover-bg: rgb(var(--blue-900)); --bs-btn-hover-border-color: rgb(var(--blue-900)); --bs-btn-active-bg: rgb(var(--blue-900)); }
.btn-outline-primary { --bs-btn-color: rgb(var(--primary)); --bs-btn-border-color: rgba(33,75,165,.35); --bs-btn-hover-bg: rgb(var(--primary)); --bs-btn-hover-border-color: rgb(var(--primary)); --bs-btn-active-bg: rgb(var(--primary)); border-width: 2px; }

/* --------------------------------------------------------------------------
   Header (floating glass pill)
   -------------------------------------------------------------------------- */
.kc-header {
  position: sticky; top: 0; z-index: 1030;
  padding: 12px 0;
  transition: padding .3s var(--ease-out);
}
.kc-nav {
  display: flex; align-items: center; gap: 1rem;
  height: 60px; padding: 0 .6rem 0 1rem;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid rgba(15,23,55,.08);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px -12px rgba(15,23,55,.25);
  transition: background .3s ease, box-shadow .3s ease;
}
.kc-header.is-scrolled { padding: 8px 0; }
.kc-header.is-scrolled .kc-nav { background: rgba(255,255,255,.92); box-shadow: 0 12px 40px -14px rgba(15,23,55,.35); }
.kc-brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: rgb(var(--blue-900)); flex-shrink: 0; }
.kc-brand img { width: auto; height: 34px; }
.kc-brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; line-height: 1; }
.kc-brand-name small { display: block; font-family: var(--font-body); font-weight: 600; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--text-muted)); margin-top: 3px; }
[dir="rtl"] .kc-brand-name small { letter-spacing: 0; }
.kc-nav-links { display: flex; align-items: center; gap: .15rem; margin: 0 auto; padding: 0; list-style: none; }
.kc-nav-links a {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: var(--radius-full);
  color: rgb(var(--text-secondary)); font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: color .2s ease, background .2s ease;
}
.kc-nav-links a:hover { color: rgb(var(--blue-900)); background: rgba(15,23,55,.05); }
.kc-nav-links a[aria-current="page"] { color: rgb(var(--blue-900)); background: rgb(var(--orange-100)); }
.kc-nav-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.kc-lang {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .75rem;
  border: 0; border-radius: var(--radius-full); background: transparent;
  font-weight: 700; color: rgb(var(--text-secondary));
}
.kc-lang:hover { background: rgba(15,23,55,.06); color: rgb(var(--blue-900)); }
.kc-donate { color: rgb(var(--heart)) !important; }
.kc-menu-btn {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: rgb(var(--blue-900)); color: #fff; place-items: center; position: relative;
}
.kc-menu-btn span, .kc-menu-btn span::before, .kc-menu-btn span::after {
  content: ''; position: absolute; left: 50%; width: 18px; height: 2px; border-radius: 2px; background: currentColor;
  transform: translateX(-50%); transition: transform .3s var(--ease-out), opacity .2s ease;
}
.kc-menu-btn span { top: 50%; }
.kc-menu-btn span::before { top: -6px; }
.kc-menu-btn span::after { top: 6px; }
.kc-menu-btn[aria-expanded="true"] span { background: transparent; }
.kc-menu-btn[aria-expanded="true"] span::before { transform: translate(-50%, 6px) rotate(45deg); }
.kc-menu-btn[aria-expanded="true"] span::after { transform: translate(-50%, -6px) rotate(-45deg); }

/* Full-screen mobile menu */
.kc-menu {
  position: fixed; inset: 0; z-index: 1029;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 1.5rem) 1.5rem 2rem;
  background: var(--grad-night); color: #fff;
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
.kc-menu.is-open { opacity: 1; visibility: visible; }
.kc-menu ul { list-style: none; padding: 0; margin: 0 0 2rem; }
.kc-menu li { overflow: hidden; }
.kc-menu a.kc-menu-link {
  display: block; padding: .35rem 0;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 10vw, 3.5rem); letter-spacing: -.04em; line-height: 1.1;
  color: #fff; text-decoration: none;
  transform: translateY(110%); transition: transform .5s var(--ease-out), color .2s ease;
}
.kc-menu.is-open a.kc-menu-link { transform: none; }
.kc-menu li:nth-child(2) a.kc-menu-link { transition-delay: .05s; }
.kc-menu li:nth-child(3) a.kc-menu-link { transition-delay: .1s; }
.kc-menu li:nth-child(4) a.kc-menu-link { transition-delay: .15s; }
.kc-menu li:nth-child(5) a.kc-menu-link { transition-delay: .2s; }
.kc-menu a.kc-menu-link:hover { color: rgb(var(--accent-secondary)); }
.kc-menu-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
body.kc-menu-open { overflow: hidden; }

@media (max-width: 991.98px) {
  .kc-nav-links, .kc-nav-actions .kc-hide-mobile { display: none; }
  .kc-menu-btn { display: grid; }
  .kc-nav { padding-inline-end: .4rem; }
  .kc-nav-actions { margin-inline-start: auto; }
}
@media (min-width: 992px) { .kc-menu { display: none; } }

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */
.kc-flash { position: relative; z-index: 5; margin: .25rem auto 0; }
.kc-flash .alert {
  display: flex; align-items: center; gap: .75rem;
  border: 0; border-radius: var(--radius-md); padding: 1rem 3rem 1rem 1.25rem;
  font-weight: 600; box-shadow: var(--shadow);
}
.kc-flash .alert-success { background: #e8f8ee; color: #0f5c30; }
.kc-flash .alert-danger { background: #fdecec; color: #8f1b1b; }

/* --------------------------------------------------------------------------
   Sections & surfaces
   -------------------------------------------------------------------------- */
.kc-section { position: relative; padding: clamp(4rem, 9vw, 7.5rem) 0; }
.kc-section--tight { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.kc-section--white { background: #fff; }
.kc-section--cream { background: rgb(var(--background-secondary)); }
.kc-section--peach { background: rgb(var(--background-tertiary)); }
.kc-section--night, .kc-on-dark { color: #fff; }
.kc-section--night { background: var(--grad-night); overflow: hidden; }
.kc-section--orange { background: var(--grad-accent); color: rgb(var(--blue-900)); overflow: hidden; }
.kc-grain::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.kc-section-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.kc-section-head.text-center { margin-inline: auto; }
.kc-section-head .kc-lead { margin-inline: inherit; }
.kc-section-head.text-center .kc-lead { margin-inline: auto; }

.kc-card {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border: 1px solid rgba(15,23,55,.05);
}
.kc-card--pad { padding: clamp(1.5rem, 3vw, 2.25rem); }
.kc-card--hover { transition: transform .35s var(--ease-out), box-shadow .35s ease; }
.kc-card--hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.kc-card--night { background: var(--grad-night); color: #fff; border: 0; }
.kc-card--orange { background: var(--grad-accent); color: rgb(var(--blue-900)); border: 0; }
.kc-card--cream { background: rgb(var(--background-secondary)); box-shadow: none; }

/* Sticker badge (slightly rotated) */
.kc-sticker {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem .95rem; border-radius: var(--radius-full);
  background: #fff; color: rgb(var(--blue-900));
  font-weight: 700; font-size: .9rem; line-height: 1.1;
  box-shadow: 0 10px 24px -8px rgba(15,23,55,.35);
  transform: rotate(var(--tilt, -4deg));
}
.kc-sticker--orange { background: rgb(var(--accent)); }
.kc-sticker--navy { background: rgb(var(--blue-900)); color: #fff; }

/* Chips */
.kc-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem; border-radius: var(--radius-full);
  background: rgb(var(--orange-100)); color: rgb(var(--accent-text));
  font-weight: 700; font-size: .82rem;
}
.kc-chip--blue { background: rgb(var(--blue-100)); color: rgb(var(--primary)); }
.kc-chip--live { background: #e6f7ec; color: #0f6b35; }
.kc-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: kcPing 2s infinite; }
@keyframes kcPing { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }

/* Big numbers */
.kc-stat-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -.04em; }
.kc-stat-label { font-weight: 600; color: rgb(var(--text-secondary)); }
.kc-on-dark .kc-stat-label { color: rgba(255,255,255,.75); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.kc-label { display: block; font-weight: 700; margin-bottom: .45rem; color: rgb(var(--text-primary)); }
.kc-input, .kc-form .form-control, .kc-form .form-select {
  width: 100%; min-height: 52px; padding: .8rem 1rem;
  border: 2px solid rgb(var(--border-color)); border-radius: var(--radius-md);
  background: #fff; font-size: 1rem; color: rgb(var(--text-primary));
  transition: border-color .2s ease, box-shadow .2s ease;
}
.kc-input:focus, .kc-form .form-control:focus, .kc-form .form-select:focus { outline: none; border-color: rgb(var(--primary)); box-shadow: 0 0 0 4px rgba(33,75,165,.14); }
textarea.kc-input { min-height: 110px; }
.kc-help { font-size: .88rem; color: rgb(var(--text-secondary)); margin-top: .35rem; }
.form-check-input:checked { background-color: rgb(var(--primary)); border-color: rgb(var(--primary)); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }

/* --------------------------------------------------------------------------
   Act card (shared by homepage, chain page)
   -------------------------------------------------------------------------- */
.kc-act {
  position: relative; display: flex; gap: 1rem; align-items: stretch;
  padding: .85rem; border-radius: var(--radius-md); background: #fff;
  border: 1px solid rgba(15,23,55,.06); box-shadow: var(--shadow-sm);
  cursor: pointer; text-align: start;
  transition: transform .3s var(--ease-out), box-shadow .3s ease;
}
.kc-act:hover, .kc-act:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); }
.kc-act-media { flex: 0 0 92px; height: 92px; border-radius: 14px; overflow: hidden; }
.kc-act-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kc-act-tile { width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.3rem; }
.kc-act-tile-0 { background: linear-gradient(135deg, #ffe6c7, #ffc98a); }
.kc-act-tile-1 { background: linear-gradient(135deg, #dfe9fb, #b8cdf4); }
.kc-act-tile-2 { background: linear-gradient(135deg, #fde0e5, #f8b8c4); }
.kc-act-tile-3 { background: linear-gradient(135deg, #d9f3e4, #ace3c4); }
.kc-act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kc-act-title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 .2rem; color: rgb(var(--blue-900)); }
.kc-act-text { color: rgb(var(--text-secondary)); font-size: .92rem; margin: 0 0 .35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kc-act-meta { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .75rem; font-size: .82rem; color: rgb(var(--text-muted)); }
.kc-act-meta i { margin-inline-end: .25rem; }
.kc-act-num { font-family: var(--font-display); font-weight: 800; font-size: .8rem; color: rgb(var(--primary)); background: rgb(var(--blue-100)); padding: .1rem .55rem; border-radius: var(--radius-full); }
.kc-act-meta .act-heart { margin-inline-start: auto; }

.act-heart {
  position: relative; display: inline-flex; align-items: center; gap: .3rem;
  border: 0; background: rgb(var(--background-secondary)); padding: .3rem .65rem; border-radius: var(--radius-full);
  color: rgb(var(--text-muted)); font-size: .82rem; font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.act-heart:hover { background: #fde2e7; color: rgb(var(--heart)); }
.act-heart-icon { font-size: 1rem; line-height: 1; transition: transform .35s var(--ease-spring); }
.act-heart.is-on { color: rgb(var(--heart)); background: #fde2e7; }
.act-heart.is-on .act-heart-icon { transform: scale(1.25); }
.act-heart:active { transform: scale(.92); }
.heart-float { position: absolute; left: 50%; bottom: 60%; color: rgb(var(--heart)); font-size: .9rem; pointer-events: none; animation: heartFloat 1s ease-out forwards; }
@keyframes heartFloat { from { opacity: 1; transform: translate(-50%, 0) scale(.8); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), -50px) scale(1.4); } }

/* --------------------------------------------------------------------------
   Marquee (infinite ticker)
   -------------------------------------------------------------------------- */
.kc-marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.kc-marquee-track { display: flex; gap: 1rem; width: max-content; animation: kcMarquee var(--marquee-duration, 60s) linear infinite; }
.kc-marquee:hover .kc-marquee-track { animation-play-state: paused; }
@keyframes kcMarquee { to { transform: translateX(-50%); } }
[dir="rtl"] .kc-marquee-track { animation-name: kcMarqueeRtl; }
@keyframes kcMarqueeRtl { to { transform: translateX(50%); } }
.kc-ticker-item {
  display: inline-flex; align-items: center; gap: .6rem; flex-shrink: 0;
  padding: .7rem 1.1rem; border-radius: var(--radius-full);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.kc-ticker-item:hover { background: rgba(255,255,255,.18); color: #fff; }
.kc-ticker-item .kc-ticker-emoji { font-size: 1.2rem; }
.kc-ticker-item .kc-ticker-place { color: rgba(255,255,255,.65); font-weight: 500; }

/* --------------------------------------------------------------------------
   Page hero (content pages)
   -------------------------------------------------------------------------- */
.kc-page-hero { position: relative; overflow: hidden; color: #fff; background: var(--grad-night); padding: clamp(4.5rem, 10vw, 7rem) 0 clamp(4rem, 9vw, 6rem); margin-top: calc(-1 * var(--nav-h) - 12px); padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 5.5rem)); }
.kc-page-hero .kc-h1 { color: #fff; margin: 1rem 0; }
.kc-page-hero-art { width: clamp(150px, 22vw, 260px); height: auto; filter: drop-shadow(0 24px 40px rgba(0,0,0,.35)); }
.kc-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.kc-blob--orange { background: #ff8e00; }
.kc-blob--blue { background: #3b6fe0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.kc-footer { position: relative; overflow: hidden; background: rgb(var(--blue-900)); color: rgba(255,255,255,.75); padding: clamp(4rem, 8vw, 6rem) 0 2rem; }
.kc-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.kc-footer a:hover { color: #fff; }
.kc-footer-cta { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -.045em; color: #fff; max-width: 14ch; }
.kc-footer h2 { font-family: var(--font-body); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--accent-secondary)); margin-bottom: 1rem; }
[dir="rtl"] .kc-footer h2 { letter-spacing: 0; }
.kc-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.kc-footer-bottom { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .88rem; }
.kc-footer-mega { position: absolute; inset-inline-end: -2vw; bottom: -4vw; font-family: var(--font-display); font-weight: 800; font-size: 22vw; line-height: .8; letter-spacing: -.06em; color: rgba(255,255,255,.035); pointer-events: none; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Motion: reveal on scroll (main.js adds .is-visible)
   -------------------------------------------------------------------------- */
html:not(.no-js) [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--reveal-delay, 0s); }
html:not(.no-js) [data-reveal="left"] { transform: translateX(-32px); }
html:not(.no-js) [data-reveal="right"] { transform: translateX(32px); }
html:not(.no-js) [data-reveal="zoom"] { transform: scale(.92); }
html:not(.no-js) [data-reveal].is-visible { opacity: 1; transform: none; }
/* legacy .reveal */
html:not(.no-js) .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
html:not(.no-js) .reveal.is-visible { opacity: 1; transform: none; }
.kc-float { animation: kcFloat 7s ease-in-out infinite; }
@keyframes kcFloat { 0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); } 50% { transform: translateY(-14px) rotate(var(--tilt, 0deg)); } }
.kc-spin-slow { animation: kcSpin 40s linear infinite; }
@keyframes kcSpin { to { transform: rotate(360deg); } }

/* Toast notifications (main.js showNotification) */
.notification-toast, .kc-toast { border-radius: var(--radius-md) !important; box-shadow: var(--shadow-lg) !important; font-weight: 600; }

/* Bootstrap modal polish */
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-backdrop.show { opacity: .55; }
.modal-header-brand { background: var(--grad-brand); color: #fff; border: 0; }
.badge-kind { background: rgb(var(--primary)); color: #fff; border-radius: var(--radius-full); }
.badge-kind-accent { background: rgb(var(--accent)); color: rgb(var(--on-accent)); border-radius: var(--radius-full); }

/* Utilities */
.kc-container-narrow { max-width: 820px; margin-inline: auto; }
.kc-rounded { border-radius: var(--radius-lg); }
.kc-shadow { box-shadow: var(--shadow); }
.min-w-0 { min-width: 0; }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html:not(.no-js) [data-reveal], html:not(.no-js) .reveal { opacity: 1; transform: none; }
  .kc-marquee-track { animation: none; flex-wrap: wrap; width: auto; }
}

/* ==========================================================================
   Homepage
   ========================================================================== */
.kc-hero {
  position: relative; overflow: hidden;
  background: var(--grad-night); color: #fff;
  margin-top: calc(-1 * var(--nav-h) - 12px);
  padding: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem)) 0 0;
}
.kc-hero .kc-display { color: #fff; }
.kc-hero-blob-1 { width: 520px; height: 520px; inset-inline-end: -140px; top: -120px; }
.kc-hero-blob-2 { width: 460px; height: 460px; inset-inline-start: -200px; bottom: 40px; opacity: .45; }
.kc-hero-rings { position: absolute; width: 900px; height: 900px; inset-inline-end: -220px; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: .5; }
.kc-hero-rings circle { fill: none; stroke: rgba(255,179,71,.25); stroke-width: 1.5; stroke-dasharray: 4 10; transform-origin: 300px 300px; animation: kcSpin 60s linear infinite; }
.kc-hero-rings circle:nth-child(2) { animation-direction: reverse; animation-duration: 80s; }
.kc-hero-rings circle:nth-child(3) { animation-duration: 120s; }
.kc-hero-stats { display: flex; flex-wrap: wrap; gap: 1.75rem; list-style: none; padding: 0; margin: 0; color: rgba(255,255,255,.75); font-weight: 600; }
.kc-hero-stats strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; color: #fff; letter-spacing: -.03em; }
.kc-hero-visual { position: relative; }
.kc-hero-art { width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(0,0,0,.45)); animation: kcFloat 8s ease-in-out infinite; }
.kc-hero-sticker { position: absolute; max-width: 260px; text-decoration: none; animation: kcFloat 7s ease-in-out infinite; z-index: 2; }
.kc-hero-sticker:hover { color: rgb(var(--blue-900)); z-index: 3; }
.kc-hero-sticker-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-hero-sticker-place { color: rgb(var(--text-muted)); font-weight: 500; }
.kc-hero-sticker-0 { top: 2%; inset-inline-start: -2%; }
.kc-hero-sticker-1 { top: 44%; inset-inline-end: -4%; animation-delay: -2.3s; }
.kc-hero-sticker-2 { bottom: 4%; inset-inline-start: 8%; animation-delay: -4.6s; }
.kc-hero-ticker { position: relative; margin-top: clamp(3rem, 7vw, 5rem); padding: 1.1rem 0; border-top: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.15); }
@media (max-width: 991.98px) {
  .kc-hero-sticker { position: static; display: inline-flex; margin: .35rem; animation: none; max-width: 100%; }
  .kc-hero-visual { text-align: center; }
  .kc-hero-rings { display: none; }
}

/* Steps */
.kc-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: stretch; }
.kc-step { padding: 2rem 1.75rem 2rem; overflow: hidden; text-align: center; }
.kc-step img { width: 210px; max-width: 75%; height: auto; margin: .5rem auto 1.25rem; display: block; transition: transform .5s var(--ease-spring); }
.kc-step:hover img { transform: translateY(-6px) rotate(-3deg) scale(1.04); }
.kc-step .kc-h3 { color: rgb(var(--blue-900)); margin-bottom: .6rem; }
.kc-step p { color: rgb(var(--text-secondary)); margin: 0; }
.kc-step-num { position: absolute; top: 1rem; inset-inline-start: 1.25rem; font-family: var(--font-display); font-weight: 800; font-size: 3.5rem; line-height: 1; color: rgba(255,142,0,.18); letter-spacing: -.05em; }
.kc-step--featured { background: rgb(var(--blue-900)); color: #fff; transform: translateY(-14px); }
.kc-step--featured .kc-h3 { color: #fff; }
.kc-step--featured p { color: rgba(255,255,255,.75); }
.kc-step--featured .kc-step-num { color: rgba(255,179,71,.3); }
.kc-step--featured:hover { transform: translateY(-20px); }
@media (max-width: 991.98px) { .kc-steps { grid-template-columns: 1fr; } .kc-step--featured { transform: none; } .kc-step--featured:hover { transform: translateY(-6px); } }

/* Log band */
.kc-logband { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem 2rem; padding: clamp(1.75rem, 4vw, 2.75rem); overflow: hidden; }
.kc-logband .kc-h2 { color: rgb(var(--blue-900)); }
.kc-logband-text { font-size: 1.1rem; font-weight: 500; color: rgba(15,23,55,.8); max-width: 34rem; }
.kc-logband-emoji { display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem; font-size: 2.2rem; flex-shrink: 0; }
.kc-logband-emoji span { display: grid; place-items: center; width: 64px; height: 64px; background: rgba(255,255,255,.55); border-radius: 20px; animation: kcFloat 5s ease-in-out infinite; }
.kc-logband-emoji span:nth-child(2) { animation-delay: -1s; }
.kc-logband-emoji span:nth-child(3) { animation-delay: -2s; }
.kc-logband-emoji span:nth-child(4) { animation-delay: -3s; }
@media (max-width: 575.98px) { .kc-logband .kc-btn { width: 100%; } .kc-logband-emoji { grid-template-columns: repeat(4, 1fr); } .kc-logband-emoji span { width: 54px; height: 54px; } }

/* Map card */
.kc-mapcard { display: grid; grid-template-columns: 1.6fr 1fr; overflow: hidden; }
.kc-mapcard-map { padding: 1.5rem; display: flex; align-items: center; min-height: 340px; }
.kc-mapcard-map svg { width: 100%; height: auto; display: block; }
.kc-mapcard-side { padding: clamp(1.75rem, 4vw, 2.75rem); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.kc-mapcard-side .kc-h2 { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.hm-land path { fill: rgba(255,255,255,0.14); stroke: rgba(255,255,255,0.25); stroke-width: .4; }
.hm-glow { fill: rgba(255,142,0,0.2); }
.hm-dot { fill: #ffb347; }
.hm-pulse { fill: none; stroke: #ff8e00; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: hmPulse 2.6s ease-out infinite; }
@keyframes hmPulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.mm-journey { stroke: #ffb347; stroke-linecap: round; stroke-linejoin: round; opacity: .95; filter: drop-shadow(0 0 3px rgba(255,142,0,.7)); }
.kc-countries { width: 100%; display: grid; gap: .5rem; }
.kc-countries li { display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; border-radius: 14px; background: rgba(255,255,255,.07); font-weight: 600; }
.kc-countries-rank { font-family: var(--font-display); font-weight: 800; color: rgb(var(--accent-secondary)); width: 1.2rem; }
.kc-countries .country-flag { font-size: 1.2rem; }
.kc-countries-count { margin-inline-start: auto; font-family: var(--font-display); font-weight: 800; }
@media (max-width: 991.98px) { .kc-mapcard { grid-template-columns: 1fr; } .kc-mapcard-map { min-height: 0; } }

/* Wall + leaders */
.kc-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 767.98px) { .kc-wall { grid-template-columns: 1fr; } }
.kc-leaders { position: sticky; top: calc(var(--nav-h) + 24px); }
.kc-leaders-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.kc-leader { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: 16px; background: rgb(var(--background-secondary)); color: rgb(var(--blue-900)); text-decoration: none; font-weight: 600; transition: transform .25s var(--ease-out), background .2s ease; }
.kc-leader:hover { background: rgb(var(--orange-100)); color: rgb(var(--blue-900)); transform: translateX(4px); }
[dir="rtl"] .kc-leader:hover { transform: translateX(-4px); }
.kc-leader-rank { width: 2rem; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; flex-shrink: 0; }
.kc-leader-name { flex: 1; min-width: 0; }
.kc-leader-count { font-family: var(--font-display); font-weight: 800; white-space: nowrap; }

/* Final CTA card */
.kc-cta-card { perspective: 1000px; }
.kc-cta-card img { width: 100%; height: auto; border-radius: 22px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); transform: rotate(-4deg); transition: transform .6s var(--ease-out); animation: kcFloat 9s ease-in-out infinite; --tilt: -4deg; }
.kc-cta-card:hover img { transform: rotate(0) scale(1.03); }
@media (max-width: 575.98px) {
  .kc-nav-log-label, .kc-brand-name small { display: none; }
  .kc-nav-log { width: 46px; min-height: 46px; padding: 0; font-size: 1.2rem; }
  .kc-brand img { height: 30px; }
  .kc-brand-name { font-size: 1.05rem; }
}
.kc-fru-slot { display: inline-flex; align-items: center; max-height: 48px; overflow: hidden; border-radius: var(--radius-full); }
.kc-fru-slot iframe { max-height: 48px; }

/* Never allow sideways scrolling (clip doesn't create a scroll container, so
   the sticky header keeps working). Side-slide reveals become vertical on
   phones so nothing pokes out while animating. */
html { overflow-x: clip; }
@media (max-width: 767.98px) {
  html:not(.no-js) [data-reveal="left"], html:not(.no-js) [data-reveal="right"] { transform: translateY(24px); }
}

/* --- Small-screen fixes --------------------------------------------------- */
/* Grid items default to min-width:auto, so a long chain name (nowrap) pushed
   leaderboard rows past their card. Let rows shrink and truncate instead. */
.kc-leaders-list { grid-template-columns: minmax(0, 1fr); }
.kc-leaders-list li, .kc-leader { min-width: 0; }
.kc-leader-count { flex-shrink: 0; }
.kc-countries { grid-template-columns: minmax(0, 1fr); }
.kc-countries li { min-width: 0; }
/* Very small phones (iPhone SE, 320–374px): logo-only brand in the header */
@media (max-width: 374.98px) {
  .kc-brand-name { display: none; }
  .kc-nav { gap: .5rem; padding-inline-start: .75rem; }
}
.kc-footer a { overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .kc-btn { white-space: normal; text-align: center; max-width: 100%; } }
/* Long unbroken words/links in user text must wrap, never widen a card */
.kc-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .kc-wall { grid-template-columns: minmax(0, 1fr); } }
.kc-wall > *, .kc-act, .kc-act-body { min-width: 0; }
.kc-act-title, .kc-act-text { overflow-wrap: anywhere; }

/* Speed: content in the first screen is visible from the very first paint —
   scroll-reveal is only for content further down. (Hidden-until-JS hero text
   delayed the "largest contentful paint" by seconds on slow phones.) */
html:not(.no-js) .kc-hero [data-reveal], html:not(.no-js) .kc-page-hero [data-reveal],
html:not(.no-js) .ch-hero [data-reveal], html:not(.no-js) .wm-stage [data-reveal],
html:not(.no-js) .kc-welcome [data-reveal] { opacity: 1; transform: none; transition: none; }

/* <picture> wrappers (AVIF + WebP fallback) must not change layout: the <img>
   keeps behaving as the direct child of its flex/grid parent. */
picture { display: contents; }
