/* Christmas 2026 — loaded only while includes/xmas.php says the layer is on.
   Site tokens and fonts only (kwo.css). The strip sits in the empty space the
   page already keeps under the fixed header and scrolls away with the page. */

.kx-strip {
  position: absolute; top: var(--kx-top, 5rem); left: 0; right: 0; z-index: 3;   /* header is 80px at the top of a page */
  min-height: 44px; overflow: hidden;           /* min: it grows if text is enlarged */
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  background: rgba(19, 41, 75, 0.95);            /* --ink-2 */
  border-top: 1px solid var(--line);
}
.kx-strip::after {                               /* the signature flame-to-amber rule */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 3;
  background: var(--ascent-grad);
}

.kx-greet {
  position: relative; z-index: 1; min-width: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 0.32em;
  font-family: 'Clash Display', system-ui, sans-serif; font-weight: 600;
  font-size: 1.05rem; line-height: 1.2; word-spacing: 0.08em; color: #fff;
  text-rendering: geometricPrecision;   /* same line width on every screen density */
  /* A soft patch of the strip's own navy: no flake ever sits on a letter. */
  background: var(--ink-2); box-shadow: 0 0 8px 6px var(--ink-2);
}
.kx-from { font-weight: 500; color: var(--mist); }

/* Ornament. Sizes are set here because kwo.css shrinks every bare svg to 1em. */
.kx-strip .kx-tree { position: relative; z-index: 2; width: 24px; height: 30px; margin-top: -2px; }
.kx-strip .kx-line { position: relative; z-index: 2; flex: 0 1 264px; min-width: 0; height: 42px; align-self: flex-start; }
.kx-strip .kx-line--r { transform: scaleX(-1); }
.kx-swag   { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.kx-string { stroke: rgba(255, 255, 255, 0.34); stroke-width: 1; }

/* Snow: two dot layers falling at different speeds. Each layer is one tile taller
   than the strip and moves down exactly one tile, so the loop has no seam. */
.kx-snow { position: absolute; inset: 0; pointer-events: none; }
.kx-snow::before, .kx-snow::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
}
.kx-snow::before {
  top: -44px; opacity: 0.8;
  background-image:
    radial-gradient(circle at 13px 7px,   #fff 1.2px, transparent 1.9px),
    radial-gradient(circle at 49px 31px,  #fff 0.9px, transparent 1.6px),
    radial-gradient(circle at 86px 18px,  #fff 1.5px, transparent 2.2px),
    radial-gradient(circle at 127px 39px, #fff 1.1px, transparent 1.8px),
    radial-gradient(circle at 158px 12px, #fff 0.8px, transparent 1.5px),
    radial-gradient(circle at 197px 25px, #fff 1.3px, transparent 2px);
  background-size: 223px 44px;
  animation: kx-fall-near 7s linear infinite;
}
.kx-snow::after {
  top: -31px; opacity: 0.5;
  background-image:
    radial-gradient(circle at 9px 22px,  #fff 0.8px, transparent 1.4px),
    radial-gradient(circle at 41px 6px,  #fff 0.7px, transparent 1.3px),
    radial-gradient(circle at 77px 15px, #fff 0.9px, transparent 1.5px),
    radial-gradient(circle at 104px 28px, #fff 0.7px, transparent 1.3px);
  background-size: 131px 31px;
  animation: kx-fall-far 9s linear infinite;
}
@keyframes kx-fall-near { to { transform: translateY(44px); } }
@keyframes kx-fall-far  { to { transform: translateY(31px); } }
@media (prefers-reduced-motion: reduce) {
  .kx-snow::before, .kx-snow::after { animation: none; }
}

/* Footer: three baubles hung from the top rule, inside the grid's top padding. */
.site-footer { position: relative; }
.site-footer .kx-hang { position: absolute; top: 0; left: 50%; width: 96px; height: 34px; margin-left: -48px; pointer-events: none; }

/* The flanking lines need about 880px beside the greeting. */
@media (max-width: 1000px) {
  .kx-strip .kx-line { display: none; }
}

/* A taller header (nav links wrap on tablets and small laptops, or text is enlarged)
   pushes the strip down by its measured height, and the page opening moves with it.
   With an 80px header this resolves to the site's own 9rem. 9.625rem is the tallest
   header measured at default text size, used when scripts are off. */
@media (min-width: 901px) {
  .hero, .page-head { padding-top: max(9rem, calc(var(--kx-top, 5rem) + 4rem)); }
}
@media (min-width: 901px) and (max-width: 1109px) {
  .kx-strip { top: var(--kx-top, 9.625rem); }
  .hero, .page-head { padding-top: calc(var(--kx-top, 9.625rem) + 4rem); }
}

@media (max-width: 900px) {
  .kx-strip { min-height: 40px; gap: 0.55rem; padding: 0 0.75rem; }
  .kx-greet { font-size: 0.84rem; }
  .kx-strip .kx-tree { width: 20px; height: 25px; }
  .kx-snow::before { opacity: 0.5; }
  .kx-snow::after  { opacity: 0.35; }
  /* The home hero starts only 88px down on a phone; make room for the strip. */
  .hero { padding-top: 8.5rem; }
}

/* Narrowest phones: two centred lines beside the tree. */
@media (max-width: 374px) {
  .kx-greet { flex-direction: column; align-items: center; font-size: 0.8rem; line-height: 1.15; }
}

@media print { .kx-strip, .kx-hang { display: none !important; } }
