/* CH 04 · Pesquisa · pen and paper.
   A spiral notebook on a wooden desk: ruled page, red margin, blue ballpoint handwriting,
   printed slips held with washi tape, rubber stamps, red-pen circles, highlighter and pencil doodles.
   Every hand-drawn stroke runs through the #wobble filter so no line is perfectly straight. */

.ch-caderno {
  --ballpoint: #1D3C80; --redpen: #C0392B; --graphite: #55534F; --rule: #BCD0E5; --margin: #E8A0A0;
  padding: clamp(56px, 8vw, 110px) var(--gutter) 24px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 220, 170, 0.12), transparent 55%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px, rgba(255, 255, 255, 0.03) 9px 11px, transparent 11px 23px),
    linear-gradient(180deg, #3A271B, #2A1C14);
  color: #222;
  cursor: url("img/cursor-pencil.png") 2 30, auto;
}
.ch-caderno a, .ch-caderno button { cursor: url("img/cursor-pencil.png") 2 30, pointer; }

.notebook { position: relative; max-width: 1180px; margin: 0 auto; transform: rotate(-0.4deg); }
.notebook::after {
  content: ""; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; pointer-events: none;
  background: radial-gradient(circle, transparent 0 41px, rgba(110, 64, 26, 0.3) 42px 45px, rgba(110, 64, 26, 0.1) 46px 49px, transparent 50px);
  transform: scaleY(0.92) rotate(18deg);
}
.nb-spiral {
  position: relative; z-index: 2; height: 34px; margin: 0 26px -16px;
  background:
    radial-gradient(circle at 14px 25px, #1b130d 0 5px, transparent 5.5px) 0 0 / 30px 34px repeat-x,
    linear-gradient(90deg, transparent 0 10px, #79838b 10px 12px, #e3e7ea 12px 15px, #8b949b 15px 18px, transparent 18px) 0 0 / 30px 24px repeat-x;
}
.nb-page {
  position: relative; padding: 34px clamp(20px, 3vw, 44px) 44px clamp(70px, 8vw, 104px);
  background:
    linear-gradient(90deg, transparent calc(clamp(70px, 8vw, 104px) - 22px), var(--margin) calc(clamp(70px, 8vw, 104px) - 22px) calc(clamp(70px, 8vw, 104px) - 20px), transparent 0),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px) 0 96px / 100% calc(100% - 96px) no-repeat,
    #FBF8EE;
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 1px 0 #e9e2cf, 0 2px 0 #d9d0b9, 0 3px 0 #e9e2cf, 0 4px 0 #cfc5ab, 0 22px 40px rgba(0, 0, 0, 0.45);
}

.nb-head { position: relative; margin-bottom: 26px; }
.nb-date { position: absolute; right: 0; top: -6px; font-family: var(--f-hand); font-size: 24px; color: var(--ballpoint); transform: rotate(-2deg); }
.nb-title { position: relative; display: inline-block; font-family: var(--f-hand); font-weight: 700; font-size: clamp(56px, 8vw, 92px); line-height: 1; color: var(--ballpoint); transform: rotate(-1.5deg); }
.nb-underline { position: absolute; left: -2%; right: -6%; bottom: -10px; width: 108%; height: 22px; overflow: visible; }
.nb-underline path { fill: none; stroke: var(--redpen); stroke-width: 3.2; stroke-linecap: round; filter: url(#wobble); stroke-dasharray: 340; stroke-dashoffset: 0; }
.js .ch-caderno:not(.is-drawn) .nb-underline path { stroke-dashoffset: 340; }
.nb-underline path { transition: stroke-dashoffset 1.1s cubic-bezier(.5, 0, .3, 1); }
.nb-underline path + path { transition-delay: .5s; stroke-width: 2.4; }
.nb-focus { max-width: 40ch; margin-top: 18px; font-family: var(--f-hand); font-weight: 500; font-size: 27px; line-height: 32px; color: var(--ballpoint); }

.nb-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(240px, 300px); gap: 34px 30px; align-items: start; }
.slip {
  position: relative; padding: 22px 22px 52px; background: #fff; color: #23201b;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.14);
  font-family: var(--f-serif); font-size: 16.5px; line-height: 1.5;
}
.slip:nth-of-type(odd) { margin-top: 10px; }
.slip-small { align-self: start; }
.slip-meta { font-family: var(--f-type); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: #6A6052; margin-bottom: 8px; }
.slip h3 { font-family: var(--f-serif); font-weight: 600; font-size: 21px; line-height: 1.2; margin-bottom: 8px; }
.slip a { color: var(--ballpoint); }
.tape {
  position: absolute; left: 50%; top: -13px; width: 96px; height: 26px; margin-left: -48px; transform: rotate(-4deg);
  background: repeating-linear-gradient(45deg, rgba(255, 214, 102, 0.72) 0 6px, rgba(255, 226, 140, 0.72) 6px 12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%);
}
.tape-b { background: repeating-linear-gradient(-45deg, rgba(240, 150, 180, 0.7) 0 5px, rgba(250, 190, 210, 0.7) 5px 10px); transform: rotate(5deg); }
.stamp {
  position: absolute; right: 16px; bottom: 12px; padding: 3px 10px;
  border: 3px solid #B3261E; border-radius: 4px; color: #B3261E;
  font-family: var(--f-type); font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  transform: rotate(-9deg); filter: url(#ink); opacity: 0.9;
}
.stamp-blue { border-color: #24479C; color: #24479C; transform: rotate(6deg); }
.js .ch-caderno:not(.is-drawn) .stamp { opacity: 0; transform: rotate(-9deg) scale(1.6); }
.stamp { transition: opacity .2s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.slip:nth-of-type(2) .stamp { transition-delay: .25s; } .slip:nth-of-type(3) .stamp { transition-delay: .5s; } .slip:nth-of-type(4) .stamp { transition-delay: .75s; }

.nb-notes { grid-column: 3; grid-row: 1 / span 3; position: relative; padding-top: 8px; color: var(--ballpoint); }
.hand { font-family: var(--f-hand); font-size: 26px; line-height: 32px; margin-bottom: 14px; }
.hand-gpa { font-size: 27px; }
.circled { position: relative; display: inline-block; padding: 0 12px; margin-right: 6px; font-weight: 700; font-size: 40px; color: var(--redpen); }
.circled::after { content: ""; position: absolute; inset: -4px -6px; border: 2.6px solid var(--redpen); border-radius: 50%; transform: rotate(-5deg); filter: url(#wobble); }
.ch-caderno mark { padding: 0 4px; color: inherit; background: linear-gradient(100deg, transparent 2%, rgba(255, 232, 0, 0.62) 4% 95%, transparent 98%); }
.hand-link { display: flex; align-items: center; gap: 8px; }
.hand-link a { color: var(--ballpoint); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.arrow-doodle { width: 60px; flex: none; fill: none; stroke: var(--ballpoint); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: url(#wobble); }
.doodle-arau { width: 120px; margin: 20px 0 0 30px; fill: none; stroke: var(--graphite); stroke-width: 2.4; stroke-linecap: round; filter: url(#wobble); opacity: 0.85; }
.hand-tiny { margin-left: 46px; font-family: var(--f-hand); font-size: 20px; color: var(--graphite); transform: rotate(-3deg); }
.seed-sketch { left: 150px; top: auto; bottom: 46px; width: 16px; height: 24px; }
.seed-sketch svg { fill: rgba(85, 83, 79, 0.08); stroke: var(--graphite); stroke-width: 1.4px; filter: url(#wobble); }
.seed-sketch svg .pinhao-seam { stroke: var(--graphite); }

.ch-caderno .placa { margin-top: 30px; }
.ch-caderno .placa-gralha { fill: none; stroke: var(--ballpoint); stroke-width: 2.4px; filter: url(#wobble); }

@media (max-width: 980px) {
  .nb-body { grid-template-columns: 1fr 1fr; }
  .nb-notes { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .doodle-arau, .hand-tiny { display: none; }
  .seed-sketch { left: auto; right: 10px; bottom: 10px; }
}
@media (max-width: 640px) {
  .nb-body, .nb-notes { grid-template-columns: 1fr; }
  .nb-date { position: static; margin-bottom: 8px; }
  .nb-page { padding-left: 48px; background:
    linear-gradient(90deg, transparent 30px, var(--margin) 30px 32px, transparent 0),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px) 0 96px / 100% calc(100% - 96px) no-repeat,
    #FBF8EE; }
}
