/* =========================================================================
   kernl footer: Ridgeline Dither Footer (from the supplied component).
   Every rule is .rdf- prefixed as in the original; the palette, fonts and
   logo are kernl's. Behaviour lives in js/footer.js.
   ========================================================================= */
.rdf-root {
  /* kernl palette: paper is the page white, tones run white -> kernl blues -> navy */
  --rdf-paper: #ffffff;
  --rdf-ink: #0b0c10;
  --rdf-muted: #5b6372;
  --rdf-line: #e6ebf3;
  --rdf-heart: #1f66f2;
  --rdf-deep: #1650d0;
  --rdf-accent: #1f66f2;
  --rdf-n: 3;
  --rdf-max: calc(1440 * var(--u));
  --rdf-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rdf-mono: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --rdf-scene-min: calc(280 * var(--u));

  position: relative; z-index: 2; display: grid; width: 100%; min-height: calc(700 * var(--u)); overflow: hidden; isolation: isolate;
  background: var(--rdf-paper); color: var(--rdf-ink); font-family: var(--rdf-sans);
  -webkit-font-smoothing: antialiased; --rdf-pad: clamp(calc(20 * var(--u)), 3.2vw, calc(30 * var(--u)));
}
.rdf-frame {
  position: relative; display: grid; grid-template-rows: auto auto minmax(var(--rdf-scene-min), 1fr);
  width: 100%; max-width: var(--rdf-max); margin: 0 auto;
}
.rdf-frame::before, .rdf-frame::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: calc(1 * var(--u)); z-index: 3; pointer-events: none;
  background: var(--rdf-line); transform: scaleY(0); transform-origin: 50% 0;
  transition: transform 1.4s cubic-bezier(.2,.7,.1,1);
}
.rdf-frame::before { left: 0; }
.rdf-frame::after { right: 0; transition-delay: .08s; }
.rdf-in .rdf-frame::before, .rdf-in .rdf-frame::after { transform: scaleY(1); }

/* hidden-until-revealed only when JS is running (no JS: everything simply shows) */
.js .rdf-r {
  opacity: 0; transform: translateY(calc(12 * var(--u))); filter: blur(calc(5 * var(--u)));
  transition: opacity .9s cubic-bezier(.2,.7,.1,1), transform 1s cubic-bezier(.2,.7,.1,1), filter .9s ease;
  transition-delay: calc(var(--d, 0) * 1ms);
}
.js .rdf-in .rdf-r { opacity: 1; transform: none; filter: none; }

.rdf-top {
  position: relative; z-index: 2; display: grid;
  grid-template-columns: minmax(0, 1.9fr) repeat(var(--rdf-n), minmax(0, 1fr));
  gap: calc(28 * var(--u)); padding: clamp(calc(44 * var(--u)), 6.4vw, calc(80 * var(--u))) var(--rdf-pad) clamp(calc(30 * var(--u)), 4vw, calc(52 * var(--u)));
}
.rdf-brand { display: flex; flex-direction: column; align-items: flex-start; gap: calc(22 * var(--u)); }
.rdf-logo {
  display: inline-flex; align-items: center; gap: calc(10 * var(--u)); color: var(--rdf-ink); text-decoration: none;
  font: 800 calc(27 * var(--u))/1 var(--f-body, var(--rdf-sans)); letter-spacing: -.045em;
}
/* kernl's own mark in place of the built-in ridge mark */
.rdf-logo img { width: calc(32 * var(--u)); height: calc(32 * var(--u)); display: block; transition: transform .7s cubic-bezier(.2,.7,.1,1); }
.rdf-logo:hover img { transform: rotate(-10deg) scale(1.06); }
.rdf-tag { margin: 0; max-width: 32ch; font-size: calc(14 * var(--u)); line-height: 1.6; color: var(--rdf-muted); text-wrap: pretty; }
.rdf-social { display: flex; gap: calc(6 * var(--u)); margin: calc(2 * var(--u)) 0 0 calc(-7 * var(--u)); padding: 0; list-style: none; }
.rdf-social a {
  display: grid; place-items: center; width: calc(36 * var(--u)); height: calc(36 * var(--u)); border-radius: calc(9 * var(--u)); color: var(--rdf-muted);
  transition: color .3s ease, background-color .3s ease, transform .45s cubic-bezier(.2,.7,.1,1);
}
.rdf-social a:hover { color: var(--rdf-ink); background: color-mix(in srgb, var(--rdf-deep) 8%, transparent); transform: translateY(calc(-2 * var(--u))); }
.rdf-social svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); display: block; }

.rdf-col h3 {
  margin: calc(4 * var(--u)) 0 calc(18 * var(--u)); font: 600 calc(13 * var(--u))/1 var(--rdf-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--rdf-muted);
}
.rdf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(11 * var(--u)); }
.rdf-link {
  position: relative; display: inline-flex; align-items: center; gap: calc(8 * var(--u));
  color: var(--rdf-ink); text-decoration: none; font-size: calc(14.5 * var(--u)); line-height: 1.35; letter-spacing: -.005em;
  transition: color .3s ease, transform .5s cubic-bezier(.2,.7,.1,1);
}
.rdf-link::before {
  content: ""; position: absolute; left: calc(-12 * var(--u)); top: 50%; width: calc(7 * var(--u)); height: calc(1 * var(--u)); background: var(--rdf-accent);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.2,.7,.1,1);
}
.rdf-link:hover { color: var(--rdf-accent); transform: translateX(calc(7 * var(--u))); }
.rdf-link:hover::before { transform: scaleX(1); }
.rdf-badge {
  font: 600 calc(10 * var(--u))/1 var(--rdf-mono); letter-spacing: .1em; text-transform: uppercase; padding: calc(4 * var(--u)) calc(6 * var(--u)) calc(3 * var(--u)); border-radius: calc(99 * var(--u));
  color: var(--rdf-accent); background: color-mix(in srgb, var(--rdf-accent) 11%, transparent);
}
.rdf-link:focus-visible, .rdf-logo:focus-visible, .rdf-social a:focus-visible {
  outline: calc(2 * var(--u)) solid var(--rdf-accent); outline-offset: calc(4 * var(--u)); border-radius: calc(3 * var(--u));
}

.rdf-bar {
  position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: calc(16 * var(--u));
  padding: 0 var(--rdf-pad); font-size: calc(12.5 * var(--u)); color: var(--rdf-muted);
}
.rdf-bar p { margin: 0; }
.rdf-credit { color: inherit; }
.rdf-heart { display: inline-block; width: calc(11 * var(--u)); height: calc(11 * var(--u)); margin: 0 calc(3 * var(--u)); vertical-align: calc(-1 * var(--u)); color: var(--rdf-heart); }
.rdf-credit:hover .rdf-heart { animation: rdf-beat 1s ease-in-out infinite; }
@keyframes rdf-beat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 32% { transform: scale(.95); } 45% { transform: scale(1.15); } }

.rdf-scene { position: relative; z-index: 1; margin-top: calc(-64 * var(--u)); overflow: hidden; cursor: crosshair; }
.rdf-scene canvas {
  position: absolute; left: 0; bottom: 0; display: block; max-width: none;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.rdf-alt {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0;
  transition: opacity .35s ease; font: 600 calc(12 * var(--u))/1 var(--rdf-mono); letter-spacing: .08em; color: var(--rdf-ink);
}
.rdf-alt i {
  position: absolute; left: calc(-4 * var(--u)); top: calc(-4 * var(--u)); width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 50%;
  background: var(--rdf-paper); box-shadow: 0 0 0 calc(1.5 * var(--u)) var(--rdf-ink);
}
.rdf-alt b { position: absolute; left: calc(-.5 * var(--u)); bottom: calc(6 * var(--u)); width: calc(1 * var(--u)); height: calc(26 * var(--u)); background: var(--rdf-ink); opacity: .55; }
.rdf-alt span {
  position: absolute; left: 0; bottom: calc(34 * var(--u)); transform: translateX(-50%); white-space: nowrap; padding: calc(5 * var(--u)) calc(7 * var(--u)) calc(4 * var(--u));
  border-radius: calc(5 * var(--u)); background: color-mix(in srgb, var(--rdf-paper) 88%, transparent); box-shadow: 0 0 0 calc(1 * var(--u)) var(--rdf-line);
  -webkit-backdrop-filter: blur(calc(4 * var(--u))); backdrop-filter: blur(calc(4 * var(--u)));
}
.rdf-sr { position: absolute; width: calc(1 * var(--u)); height: calc(1 * var(--u)); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 900px) and (hover: none), (max-width: 900px) and (pointer: coarse), (max-width: 767px) {
  .rdf-top { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: calc(40 * var(--u)); }
  .rdf-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .rdf-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: calc(36 * var(--u)); }
  .rdf-bar { flex-direction: column; align-items: flex-start; gap: calc(6 * var(--u)); }
  .rdf-scene { margin-top: calc(-40 * var(--u)); }
  .rdf-root { --rdf-scene-min: calc(220 * var(--u)); }
}
@media (prefers-reduced-motion: reduce) {
  .js .rdf-r, .rdf-frame::before, .rdf-frame::after, .rdf-link, .rdf-link::before, .rdf-social a, .rdf-logo img { transition: none; }
  .js .rdf-r { filter: none; }
  .rdf-credit:hover .rdf-heart { animation: none; }
}

/* dark mode (html.dark, see styles.css): same footer in kernl's charcoal palette; js/footer.js swaps the ridge tones */
html.dark .rdf-root {
  --rdf-paper: #111214;
  --rdf-ink: #ececee;
  --rdf-muted: #9a9ea6;
  --rdf-line: #2a2c31;
  --rdf-heart: #6fa6ff;
  --rdf-deep: #9fc2ff;
  --rdf-accent: #7fb0ff;
}
