/* 404 (js/views/not-found.js), prefix knf-. An open book with page 404 torn out; the diya looks into the gap. */
.knf { max-width: 760px; text-align: center; padding-top: 32px; padding-bottom: 48px; }

.knf-book { display: flex; justify-content: center; align-items: stretch; margin: 0 auto 28px; height: 210px; }
.knf-leaf {
  position: relative; width: 170px; border: 2px solid var(--ink); background: var(--panel);
  display: flex; flex-direction: column; padding: 18px 16px; box-sizing: border-box;
}
.knf-left { border-right-width: 1px; transform: rotate(-2deg); transform-origin: right bottom; }
.knf-right { border-left-width: 1px; transform: rotate(2deg); transform-origin: left bottom; }
.knf-pno { font-family: var(--font-serif); font-size: 14px; color: var(--muted); }
.knf-left .knf-pno { text-align: left; }
.knf-right .knf-pno { text-align: right; }
/* Ruled lines of text on each leaf. */
.knf-lines {
  flex: 1; margin-top: 12px;
  background: repeating-linear-gradient(to bottom, transparent 0 13px, #D9D9D4 13px 15px);
}
.knf-right .knf-lines { margin-right: 24px; }

/* The torn-out page: jagged edges, a big red 404, the diya peeking in. */
.knf-gap { position: relative; width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.knf-gap::before, .knf-gap::after {
  content: ''; position: absolute; top: 8px; bottom: 8px; width: 12px;
  background:
    linear-gradient(135deg, var(--panel) 50%, transparent 50%) 0 0 / 12px 12px repeat-y,
    linear-gradient(45deg, var(--panel) 50%, transparent 50%) 0 6px / 12px 12px repeat-y;
}
.knf-gap::before { left: -2px; border-left: 1px dashed var(--ink); }
.knf-gap::after { right: -2px; border-right: 1px dashed var(--ink); transform: scaleX(-1); }
.knf-big {
  font-family: var(--font-serif); font-size: 54px; font-weight: 600; line-height: 1; color: var(--accent);
  transform: rotate(-8deg); animation: knf-wobble 3.2s ease-in-out infinite;
}
.knf-mascot { margin-top: 10px; animation: knf-peek 2.6s ease-in-out infinite; }

@keyframes knf-wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(6deg) translateY(-4px); } }
@keyframes knf-peek { 0%, 100% { transform: translateX(-6px) rotate(-6deg); } 50% { transform: translateX(6px) rotate(6deg); } }

.knf-title { margin: 6px 0 10px; font-family: var(--font-serif); font-size: 44px; font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; }
.knf-excuse { margin: 0 auto 10px; max-width: 34em; font-family: var(--font-serif); font-size: 20px; line-height: 1.5; font-style: italic; }
.knf-path { margin: 0 0 24px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.knf-path code { font-family: var(--font-code); background: var(--code-bg); padding: 1px 4px; }
.knf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 600px) {
  .knf-book { height: 160px; }
  .knf-leaf { width: 110px; padding: 12px 10px; }
  .knf-gap { width: 92px; }
  .knf-big { font-size: 40px; }
  .knf-title { font-size: 32px; }
  .knf-excuse { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .knf-big, .knf-mascot { animation: none; } }
.reduce-motion .knf-big, .reduce-motion .knf-mascot { animation: none; }
