.scroll-page { overflow: visible; scroll-behavior: auto; scroll-padding-top: 0; }
.scroll-experience { display: block; height: auto; overflow: visible; background: #f8e7c8; --header-size: 64px; }
.scroll-experience .desk-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: var(--header-size);
  padding-inline: clamp(16px, 4.3vw, 68px);
  background: #f8e7c8;
  border-bottom: 1px solid #33251832;
  color: #261810;
}
.scroll-experience .desk-brand img { width: 24px; height: 34px; }
.scroll-experience .desk-brand strong, .header-brief { color: #96401e; }
.header-brief { display: inline-flex; align-items: center; min-height: 44px; gap: .35rem; font-size: 13px; font-weight: 700; }
.scroll-experience :is(#desk, #story, .case-beat) { scroll-margin-top: var(--header-size); }
.scroll-experience a, .scroll-experience button { touch-action: manipulation; }

.sketchbook {
  --case-progress: 0;
  --sketch-ink: #271b12;
  --sketch-rust: #943614;
  position: relative;
  isolation: isolate;
  max-width: 1500px;
  margin: auto;
  background: #f8e7c8 url('assets/sketchbook-paper.webp') center top / 100% auto repeat-y;
  color: var(--sketch-ink);
}
.sketchbook :focus-visible, .scroll-experience .desk-header :focus-visible { outline-color: #235d43; }
.case-stage { display: none; }
.case-beats { min-width: 0; }
.case-beat {
  position: relative;
  align-content: center;
  padding: clamp(42px, 8vw, 115px) clamp(24px, 8.4vw, 125px);
  border-bottom: 1px solid #6f422333;
}
.beat-copy { max-width: 40rem; }
.scene-kicker {
  margin-bottom: 12px;
  color: var(--sketch-rust);
  font: 700 12px/1.35 var(--mono);
  letter-spacing: .095em;
  text-transform: uppercase;
}
.sketchbook h1, .sketchbook h2 {
  margin: 0;
  color: var(--sketch-ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: .87;
  letter-spacing: -.036em;
}
.sketchbook h1 { font-size: clamp(76px, 9.5vw, 148px); }
.sketchbook h2 { font-size: clamp(52px, 7vw, 104px); }
.sketchbook h1 em, .sketchbook h2 em { color: var(--sketch-rust); font-style: italic; }
.sketchbook h1 em { display: block; }
.beat-copy > p:not(.scene-kicker) {
  max-width: 34ch;
  margin: 18px 0 0;
  color: #3b281b;
  font-size: clamp(16px, 1.55vw, 21px);
  line-height: 1.49;
}
.story-entry, .sketch-brief { display: inline-flex; align-items: center; width: fit-content; min-height: 44px; gap: .7rem; }
.sketch-next { margin-top: 22px; color: #3b281b; font: italic 400 clamp(23px, 3.1vw, 34px)/1 var(--serif); }
.sketch-next span { color: var(--sketch-rust); font: 600 24px/1 var(--sans); }
.sketch-next:hover, .sketch-brief:hover { text-decoration-thickness: 2px; text-decoration-line: underline; }
.sketch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 17px; margin-top: 22px; }
.sketch-action {
  padding: 2px 19px;
  border-radius: 999px;
  background: #292019;
  color: #fff1d7;
  font-weight: 750;
}
.sketch-action:hover { background: #275139; }
.sketch-brief { color: #4a3020; font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) and (min-height: 500px) {
  .sketchbook.motion-active { display: grid; grid-template-columns: minmax(0, 1fr); }
  .motion-active .case-stage, .motion-active .case-beats { grid-area: 1 / 1; }
  .motion-active .case-stage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    align-self: start;
    top: var(--header-size);
    height: calc(100svh - var(--header-size));
    margin: 0 clamp(32px, 5.4vw, 81px) 0 47.5%;
    pointer-events: none;
  }
  .motion-active .case-beats { z-index: 1; }
  .motion-active .case-beat { min-height: calc(100svh - var(--header-size)); display: grid; justify-items: start; }
  .motion-active .beat-copy { max-width: min(100%, 37vw); }
  .sketch-evidence { position: relative; width: 100%; aspect-ratio: 1.82; container-type: inline-size; }
  .sketch-thread {
    position: absolute;
    top: 50%;
    inset-inline: 13%;
    height: 4px;
    border-radius: 50%;
    background: #a24720;
    transform-origin: left;
    transform: scaleX(calc(.83 + var(--case-progress) * .17)) rotate(-1deg);
  }
  .sketch-receipt {
    position: absolute;
    top: 49%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 32%;
    aspect-ratio: 1;
    padding: 1.7% 3.8% 2.3%;
    background: url('assets/sketchbook-receipt.webp') center / 100% 100% no-repeat;
    color: #2d2217;
    text-align: center;
    line-height: 1.1;
  }
  .receipt-first { left: 0; transform: translateY(-50%) rotate(-9deg); }
  .receipt-last { right: 0; transform: translateY(-50%) rotate(7deg); }
  .sketch-receipt > * { position: relative; }
  .sketch-receipt span { font: 800 clamp(7px, 2.2cqi, 13px)/1.05 var(--mono); text-transform: uppercase; }
  .sketch-receipt time { margin-top: .12em; font: 400 clamp(21px, 7.8cqi, 56px)/1.05 var(--serif); }
  .sketch-receipt strong { font: 800 clamp(9px, 3.15cqi, 21px)/1.05 var(--mono); text-transform: uppercase; }
  .trace-middle { position: absolute; inset: 0; }
  .trace-unknown {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transform: rotate(calc(-10deg + var(--case-progress) * 12deg));
  }
  .trace-unknown img { width: clamp(104px, 33cqi, 210px); height: auto; }
  .sketch-ruler {
    position: absolute;
    top: 48%;
    left: 50%;
    display: none;
    width: 56%;
    transform: translate(-50%, -50%) rotate(-3deg);
    filter: drop-shadow(0 11px 5px #4b2d1c42);
  }
  .sketch-ruler img { display: block; width: 100%; border-radius: 12%; }
  .trace-found {
    position: absolute;
    inset: 50% 0 auto;
    display: grid;
    transform: translateY(-26%);
    color: #261801;
    text-align: center;
    text-transform: uppercase;
  }
  .trace-found time { font: 400 clamp(22px, 6.8cqi, 48px)/.94 var(--serif); }
  .trace-found strong { font: 900 clamp(9px, 2.5cqi, 17px)/1.3 var(--mono); }
  .sketchbook:not([data-beat='0']) .trace-unknown,
  .sketchbook:not([data-beat='0']) .timeline-unknown { display: none; }
  .sketchbook:not([data-beat='0']) .sketch-ruler { display: block; animation: pin-record 410ms cubic-bezier(.14, .74, .28, 1) both; }
  @keyframes pin-record {
    from { transform: translate(-50%, -74%) rotate(10deg) scale(.86); opacity: 0; }
    to { transform: translate(-50%, -50%) rotate(-3deg) scale(1); opacity: 1; }
  }

  .sketch-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-inline: 13%;
    border-top: 2px solid #523721ac;
    color: #59402e;
    font: italic 400 clamp(19px, 3vw, 31px)/1 var(--serif);
  }
  .sketch-timeline span { position: relative; padding-top: 13px; }
  .sketch-timeline span::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    translate: -50% -56%;
    width: .35em;
    height: .35em;
    border-radius: 50%;
    background: #4d321f;
  }
  .sketch-timeline span:nth-child(2)::before { background: #fbf0d6; border: 1px solid #4d321f; }
  .timeline-found { display: none; }
  .sketchbook:not([data-beat='0']) .timeline-found { display: inline; color: #963214; }
  .sketchbook:not([data-beat='0']) .sketch-timeline span:nth-child(2)::before { background: #9c381c; }
}

.scroll-experience .desk {
  min-height: min(680px, 94svh);
  grid-template-rows: auto;
  overflow: visible;
  padding: clamp(46px, 7vw, 115px) clamp(24px, 7.8vw, 112px);
  background: radial-gradient(ellipse at 66% 30%, #26392d, #18241c 76%);
  align-items: center;
}
.scroll-experience .desk-opening h2 {
  margin: 0 0 16px;
  font: 400 clamp(50px, 7vw, 103px)/.89 var(--serif);
  letter-spacing: -.055em;
  color: var(--front-fg);
}
.scroll-experience .desk-opening h2 em { color: var(--front-accent); }
.scroll-experience .desk-opening p { display: block; }
.scroll-experience .desk-workspace { max-height: none; overflow: visible; align-self: center; margin: 0; }
.desk-tabs { display: flex; gap: 4px 17px; flex-wrap: wrap; margin-top: 14px; }
.desk-tabs a { display: inline-flex; min-height: 44px; align-items: center; color: var(--front-soft); font-weight: 650; font-size: 14px; }
.desk-tabs a[aria-current] { color: var(--front-accent); border-bottom: 1px solid currentColor; }
.brief-evidence { border-left: 2px solid var(--front-accent); padding: 5px 9px; margin-top: 10px; color: var(--front-soft); }
.brief-evidence p { margin: 0; }
.brief-evidence button { font-size: 13px; }
.scroll-experience .desk-footer { background: #18241c; }

@media (max-width: 760px) {
  .scroll-experience { --header-size: 58px; }
  .scroll-experience .desk-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; padding-inline: 14px; }
  .scroll-experience .desk-brand { font-size: 19px; gap: 6px; white-space: nowrap; }
  .scroll-experience .desk-nav { display: flex; justify-content: center; gap: 6px; }
  .scroll-experience .desk-nav a { font-size: 12px; padding: 0 3px; }
  .scroll-experience .desk-nav a:first-child, .scroll-experience .desk-nav a:last-child { display: none; }
  .header-brief { font-size: 11px; white-space: nowrap; }
  .sketchbook {
    --stage-start: clamp(224px, 32svh, 290px);
    --stage-size: clamp(172px, 30svh, 308px);
    background-size: 100% max(100svh, 640px);
  }
  .case-beat { padding-inline: clamp(27px, 8vw, 64px); }
  .sketchbook h1 { font-size: clamp(60px, min(18vw, 10svh), 105px); }
  .sketchbook h2 { font-size: clamp(51px, 11.9vw, 92px); }
  .scroll-experience .desk[data-active] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: 16px; }
  .scroll-experience .desk-opening { padding: 0; }
  .scroll-experience .desk-panel { padding: 15px; }
}
@media (max-width: 760px) and (min-height: 500px) and (prefers-reduced-motion: no-preference) {
  .motion-active .case-stage {
    z-index: 2;
    height: var(--stage-size);
    margin: var(--stage-start) 18px 0 25px;
    background: #f7e8c9 url('assets/sketchbook-paper.webp') 50% 48% / 116% auto no-repeat;
  }
  .motion-active .sketch-evidence { margin-inline: auto; height: calc(var(--stage-size) - 37px); width: min(100%, 445px); }
  .motion-active .sketch-timeline { width: min(74%, 320px); margin-inline: auto; }
  .motion-active .case-beat {
    min-height: max(440px, 76svh);
    align-content: start;
    padding-top: calc(var(--stage-size) + 28px);
    padding-bottom: 26px;
  }
  .motion-active .beat-copy { max-width: 100%; }
  .motion-active .sketch-opening {
    align-content: space-between;
    min-height: max(var(--stage-start) + var(--stage-size) + 77px, 100svh - var(--header-size));
    padding-top: 22px;
    padding-bottom: clamp(18px, 100svh - var(--header-size) - var(--stage-start) - var(--stage-size) - 74px, 114px);
  }
  .sketch-opening .beat-copy > p { margin-top: 13px; }
  .sketch-next { margin-top: 0; }
}
