/* v4 redpen step owns this file: Kako's Red Pen section, CRT result, mood board.
   Chapter change: always a dark desk room (fixed colours, so it reads in day and night). */
.redpen {
  position: relative; overflow: hidden; color: #fff1df;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(47,211,196,.14), transparent 60%),
    repeating-linear-gradient(92deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #14191a 0%, #1c1612 60%, #120e0b 100%);
  padding-block: clamp(56px, 10vw, 120px);
}
.redpen .section-head h2 { font-size: clamp(2.4rem, 9vw, 5rem); line-height: 1; color: #fff1df; }
.redpen .eyebrow { color: #2fd3c4; }
.redpen .lede, .redpen label, .redpen .redpen-note { color: #fff1df; }
.redpen .redpen-row input { background: #0c1415; color: #fff1df; border: 1px solid rgba(255,241,223,.3); }
.redpen .redpen-row input::placeholder { color: rgba(255,241,223,.55); }
.rp-inline-error { margin: 8px 0 0; color: #ffb3a1; font-weight: 600; }
.rp-inline-error[hidden] { display: none; }
.redpen .rp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.rp-wrap { margin-top: 24px; color: #fff1df; }
.rp-desk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 20px; border-radius: 18px;
  background: linear-gradient(180deg, #3a2a1d, #26190f); border: 1px solid rgba(255,241,223,.12); }
@media (min-width: 720px) { .rp-desk { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); padding: 28px; } }

.rp-crt { position: relative; padding: 18px 18px 26px; border-radius: 26px;
  background: linear-gradient(160deg, #d9cdb8, #a99c84 55%, #8c806a);
  box-shadow: 0 12px 30px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.4); }
.rp-screen { position: relative; min-height: 190px; padding: 16px; border-radius: 18px / 22px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #0f3b36 0%, #07211f 70%, #031110 100%);
  color: #7ff7e4; text-shadow: 0 0 8px rgba(47,211,196,.7);
  box-shadow: inset 0 0 40px rgba(0,0,0,.8), inset 0 0 12px rgba(47,211,196,.35); font-family: ui-monospace, Menlo, Consolas, monospace; }
.rp-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
.rp-led { position: absolute; right: 22px; bottom: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: #ff5a3c; box-shadow: 0 0 8px #ff5a3c; }

.rp-site { display: flex; gap: 12px; align-items: center; }
.rp-site-txt { min-width: 0; }
.rp-site-title { margin: 0; font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-site-domain { margin: 2px 0 0; font-size: .85rem; opacity: .8; overflow-wrap: anywhere; }
.rp-fav { position: relative; flex: none; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  background: rgba(47,211,196,.18); border: 1px solid rgba(127,247,228,.5); }
.rp-fav-letter { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; }
.rp-fav img { position: absolute; inset: 2px; width: 32px; height: 32px; object-fit: contain; background: #fff; border-radius: 6px; }
.rp-score { margin-top: 14px; display: flex; align-items: baseline; gap: 4px; }
.rp-score-n { font-size: clamp(3.4rem, 14vw, 5.5rem); font-weight: 800; line-height: 1; }
.rp-score-of { font-size: 1.3rem; opacity: .8; }
.rp-score-label { margin: 0; font-weight: 700; }
.rp-score-small { margin: 2px 0 0; font-size: .75rem; opacity: .75; }

.rp-boot { margin: 0 0 8px; opacity: 0; animation: rp-boot .5s ease forwards; animation-delay: calc(var(--i) * .7s); }
@keyframes rp-boot { to { opacity: 1; } }

.rp-who { display: flex; justify-content: center; }
.rp-frame { position: relative; width: min(220px, 70%); padding: 10px; background: #f5ead6;
  border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.5), inset 0 0 0 3px #6b4a2b; }
.rp-portrait { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.rp-portrait-sm { width: 88px; border-radius: 50%; border: 3px solid #f5ead6; flex: none; }
.rp-stamp { position: absolute; left: 50%; top: 82%; padding: 4px 10px; border: 3px solid #e5322b; border-radius: 6px;
  color: #e5322b; font-weight: 900; letter-spacing: .12em; font-size: 1.1rem; background: rgba(255,241,223,.12);
  transform: translate(-50%, -50%) rotate(-14deg); opacity: .92; pointer-events: none; }
html:not(.fx-off) .rp-result:not(.rp-static) .rp-stamp { animation: rp-stamp .55s cubic-bezier(.2,1.6,.4,1) .35s backwards; }
@keyframes rp-stamp {
  0% { transform: translate(-50%, -50%) rotate(-30deg) scale(3); opacity: 0; }
  70% { transform: translate(-50%, -50%) rotate(-14deg) scale(.92); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
}

.rp-notes, .rp-board { margin-top: 20px; padding: 20px; border-radius: 14px; background: rgba(255,241,223,.06);
  border: 1px solid rgba(255,241,223,.14); }
.rp-h { margin: 0 0 12px; font-size: clamp(1.4rem, 5vw, 2rem); color: #fff1df; }
.rp-list, .rp-bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rp-note { font-family: "Caveat", "Comic Sans MS", cursive; font-size: 1.35rem; line-height: 1.25; color: #ff6b5e;
  padding-left: 28px; position: relative; overflow-wrap: anywhere; }
.rp-note::before { content: "✗"; position: absolute; left: 0; font-weight: 700; }
.rp-pass, .rp-clean, .rp-auto { margin: 14px 0 0; font-size: .95rem; opacity: .9; }
.rp-swatches { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rp-swatch { position: relative; aspect-ratio: 1; border-radius: 10px; border: 2px solid rgba(255,241,223,.7); overflow: hidden; }
.rp-swatch-hex { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px; text-align: center; font-size: .62rem;
  background: rgba(0,0,0,.65); color: #fff; font-family: ui-monospace, Menlo, monospace; }
.rp-bullets li { padding-left: 24px; position: relative; }
.rp-bullets li::before { content: "→"; position: absolute; left: 0; color: #2fd3c4; }
.rp-actions { margin-top: 20px; }
.rp-fix { min-height: 48px; }

.rp-error { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 14px;
  background: rgba(255,241,223,.06); border: 1px solid rgba(255,241,223,.14); }
.rp-error-line { margin: 0; font-size: 1.15rem; }
@media (max-width: 430px) {
  .rp-desk { padding: 14px; }
  .rp-swatch-hex { font-size: .52rem; }
}
#redpen { scroll-margin-top: 72px; }
