/* v01 The Scout's Notebook: tokens, paper, type, buttons, the clipboard, sticky notes, stamps. */
:root {
  --kraft: #c29a66; --kraft-2: #a97f4c; --board: #7d5531; --board-2: #6a4526;
  --paper: #fbf6e8; --paper-2: #f2e8cf; --rule: #bcd2e2; --marginl: #e6a19b;
  --graphite: #2d2b28; --pencil: #514c46; --faint: #8c857a;
  --red: #c4372c; --green: #23784a; --sticky: #ffe36b; --sticky-2: #f7cf3f; --tape: rgba(255, 251, 232, .62);
  --hand: 'Bradley Hand', 'Noteworthy', 'Segoe Print', 'Comic Sans MS', cursive;
  --note: 'Noteworthy', 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --typed: 'American Typewriter', 'Courier New', ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-pop: cubic-bezier(.2, 1.4, .4, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--kraft) var(--fibre); color: var(--graphite);
  font: 400 17px/1.4 var(--note); overflow-x: clip; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body:not([data-phase="results"]) { overflow: hidden; height: 100%; }
button { font: inherit; color: inherit; }
.hand { font-family: var(--hand); font-weight: 700; }
.note { font-family: var(--note); }
.typed { font-family: var(--typed); letter-spacing: .04em; }
[hidden] { display: none !important; }

/* ---- layers ---- */
.stage { position: fixed; inset: 0; z-index: 1; }
body[data-stage="off"] .stage { visibility: hidden; }
.hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.screen { position: fixed; inset: 0; z-index: 10; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.mute {
  position: fixed; z-index: 30; top: calc(10px + var(--safe-t)); right: 10px; width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(45, 43, 40, .5); background: rgba(251, 246, 232, .88); color: var(--graphite);
  display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  transition: transform .15s var(--ease-pop);
}
.mute svg { width: 24px; height: 24px; }
.mute:active { transform: scale(.9); }
.mute.is-off { color: var(--faint); }

/* ---- paper ---- */
.paper { background: var(--paper) var(--grain); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 10px 24px rgba(40, 24, 8, .28); }
.board {
  position: relative; background: var(--board) var(--fibre); border-radius: 18px; padding: 30px 10px 10px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 18px 40px rgba(20, 10, 0, .45);
}
.board__clip { position: absolute; top: -16px; left: 50%; width: 150px; margin-left: -75px; z-index: 3; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .35)); }
.board__clip svg { display: block; width: 100%; height: auto; }
.sheet { position: relative; border-radius: 3px; padding: 24px 18px 18px; }
.sheet__kicker { margin: 0 0 10px; font-size: 13px; color: var(--pencil); }
.sticky {
  position: relative; background: linear-gradient(170deg, var(--sticky) 0%, var(--sticky-2) 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 12px 22px rgba(30, 20, 0, .3); border-radius: 2px 2px 14px 2px;
}
.sticky::before {
  content: ''; position: absolute; top: -11px; left: 50%; width: 88px; height: 24px; margin-left: -44px;
  background: var(--tape); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

/* ---- pencil strokes: any svg path with pathLength=1 can draw itself ---- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes write { to { clip-path: inset(-20% 0 -20% 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pagein { from { opacity: 0; transform: translateY(40px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes pageout { to { opacity: 0; transform: translateY(-30px) rotate(2deg) scale(.98); } }
@keyframes wiggle { 0% { transform: rotate(var(--rot, -2deg)) scale(.96); } 45% { transform: rotate(calc(var(--rot, -2deg) + 2deg)) scale(1.03); } 100% { transform: rotate(var(--rot, -2deg)) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px) scale(1.02); } }
.page-in { animation: pagein .5s var(--ease-out) both; }
.is-leaving { animation: pageout .3s ease-in both; }

/* ---- buttons ---- */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 62px;
  padding: 10px 22px; border: 0; border-radius: 16px 12px 18px 13px; cursor: pointer;
  background: var(--graphite); color: var(--paper); font: 700 31px/1 var(--hand);
  box-shadow: 0 5px 0 #0f0e0d, 0 12px 20px rgba(0, 0, 0, .25); transition: transform .12s var(--ease-out), box-shadow .12s, background .2s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0f0e0d, 0 4px 10px rgba(0, 0, 0, .25); }
.btn:focus-visible { outline: 3px dashed var(--red); outline-offset: 4px; }
.btn__arrow { font: 700 30px/1 var(--hand); transition: transform .2s var(--ease-pop); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn[disabled] { background: #6d675f; cursor: progress; box-shadow: 0 5px 0 #3c3833; font-size: 25px; }
/* a new screen's button arming (double-tap guard): looks live, just not yet tappable */
.btn.is-arming[disabled] { background: var(--graphite); box-shadow: 0 5px 0 #0f0e0d, 0 12px 20px rgba(0, 0, 0, .25); font-size: 31px; cursor: default; }
.mute:focus-visible, .rate__n:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }
.pt-mk:focus-visible { outline: none; }
.pt-mk:focus-visible .nb-mk::before { box-shadow: 0 0 0 4px var(--red), 0 4px 12px rgba(0, 0, 0, .4); }
.btn__spin { width: 22px; height: 22px; border: 3px solid rgba(251, 246, 232, .35); border-top-color: var(--paper); border-radius: 50%; animation: spin .8s linear infinite; }
.btn.is-ready { animation: rise .4s var(--ease-pop) both; }
.btn.is-nudge { animation: nudge .9s ease-in-out 2; }
.btn.is-later { opacity: 0; animation: rise .45s var(--ease-out) forwards; }

/* ---- checkboxes (the report's parts) ---- */
.checks { list-style: none; margin: 14px 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font: 400 16px/1.2 var(--note); color: var(--pencil); }
.checks li { display: flex; align-items: center; gap: 6px; }
.checks li.is-done { color: var(--graphite); }
.box { width: 22px; height: 22px; border: 2px solid var(--pencil); border-radius: 3px 5px 3px 4px; display: grid; place-items: center; }
.box__tick { width: 26px; height: 26px; margin: -6px -4px 0 0; }
.box__tick path, .sec__tick path, .rev__tick path, .mo__tick path, .hud__mark path { fill: none; stroke: var(--green); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .45s .25s var(--ease-out) forwards; }

/* ---- the rubber stamp ---- */
.stamp {
  display: inline-block; font: 400 34px/1 var(--typed); letter-spacing: .1em; color: var(--red); padding: 8px 14px 6px;
  border: 4px solid currentColor; border-radius: 9px; transform: rotate(-8deg);
  -webkit-mask-image: var(--ink); mask-image: var(--ink); -webkit-mask-size: 200px; mask-size: 200px; mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* while the engine loads, the landing sits on paper and kraft, not on the engine's black first frame */
body[data-phase="boot"] .stage { opacity: 0; }
.stage { transition: opacity .6s ease; }
.btn--go[disabled] { font-size: 22px; white-space: nowrap; }
