/* The handwritten, paper-note details of the original visual direction. */
:root { --note-yellow: #ffea8b; --note-pink: #ffd6e6; --note-blue: #d4edf2; }
.sticky-note {
  --note-angle: -5deg;
  position: relative;
  isolation: isolate;
  color: #24201f;
  background: var(--note-color, var(--note-yellow));
  padding: 28px 22px;
  border-radius: 1px 2px 8px 1px;
  box-shadow: 2px 8px 11px -7px #27132b55, 0 1px 2px #27132b10;
  rotate: var(--note-angle);
  transform-origin: 50% 10%;
  transition: rotate .45s ease, box-shadow .45s ease, scale .45s ease;
}
.sticky-note::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 28px;
  background: #ffffff25;
  border-bottom: 1px solid #00000004;
  pointer-events: none;
}
.sticky-note:hover { rotate: 0deg; scale: 1.025; box-shadow: 4px 17px 20px -12px #27132b60; }
.ink-underline { position: relative; display: inline-block; }
.ink-underline::after {
  content: '';
  position: absolute;
  left: -2%; right: -2%; bottom: -.07em;
  height: .16em; min-height: 4px;
  background: currentColor;
  mask: url('/assets/594c8f6fbea4b24b.svg') center / 100% 100% no-repeat;
  transform: scaleX(1);
  transform-origin: left center;
  pointer-events: none;
}
.replica-reveal-pending .ink-underline::after,
.ink-underline.replica-reveal-pending::after { transform: scaleX(0); }
.replica-reveal .ink-underline::after,
.ink-underline.replica-reveal::after { animation: inkDraw 1.05s cubic-bezier(.16,1,.3,1) .7s both; }
@keyframes inkDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-note {
  position: absolute;
  width: 193px;
  min-height: 180px;
  right: 6px;
  bottom: 0;
  padding: 28px 16px 23px;
  font-size: 29px;
  line-height: 1.12;
  transform: none;
  --note-angle: 7deg;
}
.hero-arrow { bottom: 175px; right: 26px; width: 90px; rotate: -12deg; }
.hero-collage.replica-reveal .hero-note { animation: noteFloat 5.5s ease-in-out 1.3s infinite; }
@keyframes noteFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.hero-collage .hero-arrow { animation: arrowNudge 4.8s ease-in-out infinite; }
@keyframes arrowNudge { 0%,70%,100% { translate: 0 0; } 82% { translate: -3px 7px; } }
.purpose-copy .closing-note { max-width: 410px; }
.challenges-grid { grid-template-columns: .95fr 1.2fr; gap: 8%; align-items: center; }
.note-board { display: grid; grid-template-columns: 1fr 1fr; gap: 29px 22px; padding: 20px 8px; }
.note-board article,
.note-board article:last-child {
  display: block;
  border: 0;
  padding: 24px;
  background: var(--note-color, var(--note-yellow));
  min-height: 240px;
}
.note-board article:nth-child(1) { --note-angle: -5deg; }
.note-board article:nth-child(2) { --note-angle: 4deg; --note-color: var(--note-pink); margin-top: 17px; }
.note-board article:nth-child(3) { --note-angle: 3deg; --note-color: var(--note-blue); }
.note-board article:nth-child(4) { --note-angle: -4deg; --note-color: #f4e7fa; margin-top: 17px; }
.note-board .index { display: block; color: #554e4f; margin-bottom: 12px; font-size: 12px; }
.note-board h3 { font-family: Kalam,cursive; font-size: 25px; line-height: 1.12; letter-spacing: -.035em; margin-bottom: 12px; }
.note-board p { font-size: 14px; line-height: 1.6; }
.note-board .sticky-note.replica-reveal { animation-name: noteLand; animation-duration: .95s; }
@keyframes noteLand {
  from { opacity: 0; translate: 0 65px; scale: .87; }
  70% { opacity: 1; translate: 0 -5px; scale: 1.015; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
.advance-inner { position: relative; }
.advance h2 { width: max-content; max-width: 100%; margin: 0 auto 30px; }
.advance h2::after { left: 6%; right: 0; height: .05em; bottom: .1em; }
.advance p.margin-note { position: absolute; margin: 0; font-size: 27px; line-height: 1.15; width: 175px; min-height: 165px; text-align: center; z-index: 1; }
.advance p.margin-note-left { left: -10px; top: 25px; --note-angle: -10deg; }
.advance p.margin-note-right { right: -10px; bottom: 0; --note-angle: 9deg; --note-color: var(--note-blue); }
.photo-caption { width: fit-content; margin-inline: auto; }
.motion-word { display: inline-block; will-change: auto; }
.motion-ready .motion-word { opacity: 0; translate: 0 .65em; }
.motion-ready.motion-visible .motion-word {
  animation: wordEnter .85s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(var(--word-index, 0) * 65ms);
}
@keyframes wordEnter { from { opacity: 0; translate: 0 .65em; rotate: 2deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
[data-letter-reveal] .motion-word { transform-origin: 50% 85%; }
[data-letter-reveal].motion-visible .motion-word { animation-name: letterEnter; animation-duration: 1.1s; }
@keyframes letterEnter {
  from { opacity: 0; translate: 0 .35em; rotate: 10deg; scale: .8; }
  65% { opacity: 1; translate: 0 -.035em; rotate: -2deg; scale: 1.035; }
  to { opacity: 1; translate: 0 0; rotate: 0deg; scale: 1; }
}
.hero .cd-words-wrapper.replica-typing { display: inline-grid !important; vertical-align: baseline; white-space: nowrap; }
.hero .replica-typing > span { grid-area: 1 / 1; }
.hero .replica-typing > .typing-measure { visibility: hidden; pointer-events: none; }
.hero .typing-value { position: relative; width: fit-content; min-width: .05em; }
.hero .typing-value::after { content: ''; position: absolute; right: -.035em; top: .12em; bottom: .18em; width: 2px; background: var(--pink); animation: caretBlink .85s step-end infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }
@media(min-width:801px) and (max-width:1100px) {
  .challenges-grid { gap: 5%; }
  .note-board { gap: 20px 14px; }
  .note-board article, .note-board article:last-child { padding: 20px; min-height: 255px; }
  .note-board h3 { font-size: 23px; }
  .advance p.margin-note { width: 145px; min-height: 145px; font-size: 23px; }
  .advance p.margin-note-left { top: -40px; }
  .advance p.margin-note-right { bottom: -40px; }
}
@media(max-width:800px) {
  .challenges-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-note { width: 175px; min-height: 165px; font-size: 26px; right: 0; bottom: 2px; }
  .hero-arrow { bottom: 160px; right: 15px; }
  .advance-inner { display: flex; flex-direction: column; align-items: center; }
  .advance p.margin-note { position: relative; font-size: 22px; width: 165px; min-height: 130px; }
  .advance p.margin-note-left { left: auto; top: auto; align-self: flex-start; margin: 0 0 35px 12px; }
  .advance p.margin-note-right { right: auto; bottom: auto; align-self: flex-end; margin: 35px 12px 0 0; }
  .advance h2 { margin-bottom: 25px; }
  .note-board { max-width: 650px; width: 100%; margin: auto; }
  .note-board article, .note-board article:last-child { min-height: 220px; }
}
@media(max-width:480px) {
  .hero-note { width: 145px; min-height: 142px; padding: 22px 12px 18px; font-size: 22px; right: -4px; }
  .hero-arrow { width: 65px; bottom: 140px; }
  .hero h1 { font-size: clamp(2.05rem, 8vw, 2.45rem); }
  .note-board { grid-template-columns: 1fr; gap: 22px; padding-inline: 14px; max-width: 350px; }
  .note-board article, .note-board article:last-child { min-height: 0; padding: 25px 27px 30px; margin: 0; }
  .note-board h3 { font-size: 28px; }
  .note-board p { font-size: 15px; }
}
@media(prefers-reduced-motion:reduce) {
  .motion-ready .motion-word { opacity: 1; translate: none; }
  .hero .typing-value::after { display: none; }
  .sticky-note, .sticky-note:hover { transition: none; scale: 1; }
  .ink-underline::after { transform: none; }
}

/* More legible motion: larger travel, distinct timing, and replay on return. */
@media(prefers-reduced-motion:no-preference) {
  .replica-reveal { animation-duration: 1.15s; animation-timing-function: cubic-bezier(.16,1,.3,1); }
  @keyframes replicaUp { from { opacity:0; transform:translateY(80px); } to { opacity:1; transform:translateY(0); } }
  @keyframes replicaDown { from { opacity:0; transform:translateY(-65px); } to { opacity:1; transform:translateY(0); } }
  @keyframes replicaLeft { from { opacity:0; transform:translateX(-80px); } to { opacity:1; transform:translateX(0); } }
  @keyframes replicaRight { from { opacity:0; transform:translateX(80px); } to { opacity:1; transform:translateX(0); } }
  .motion-ready.motion-visible .motion-word { animation-duration:1.2s; animation-delay:calc(var(--word-index,0) * 105ms); }
  @keyframes wordEnter { from { opacity:0; translate:0 1.15em; rotate:5deg; scale:.94; filter:blur(3px); } 70% { opacity:1; filter:blur(0); } to { opacity:1; translate:0 0; rotate:0deg; scale:1; filter:blur(0); } }
  [data-letter-reveal].motion-visible .motion-word { animation-duration:1.35s; animation-delay:calc(var(--word-index,0) * 125ms); }
  @keyframes letterEnter { from { opacity:0; translate:0 .8em; rotate:20deg; scale:.65; } 65% { opacity:1; translate:0 -.09em; rotate:-5deg; scale:1.08; } to { opacity:1; translate:0 0; rotate:0deg; scale:1; } }
  .note-board .sticky-note.replica-reveal { animation-duration:1.2s; }
  @keyframes noteLand { from { opacity:0; translate:0 95px; scale:.8; transform:rotate(-12deg); } 65% { opacity:1; translate:0 -12px; scale:1.03; transform:rotate(4deg); } to { opacity:1; translate:0 0; scale:1; transform:rotate(0deg); } }
  .sticky-note:hover { rotate:0deg; scale:1.065; translate:0 -8px; }
  .hero-collage.replica-reveal .hero-note { animation:noteFloat 3.8s ease-in-out 1.3s infinite; }
  @keyframes noteFloat { 0%,100% { translate:0 0; transform:rotate(-2deg); } 50% { translate:0 -20px; transform:rotate(3deg); } }
  .margin-note.motion-visible { animation:noteLand 1.2s both, noteFloat 5s ease-in-out 1.2s infinite; }
  .margin-note-right.motion-visible { animation-delay:200ms,1.4s; }
  .hero-collage .hero-arrow { animation:arrowNudge 3.1s ease-in-out infinite; }
  @keyframes arrowNudge { 0%,65%,100% { translate:0 0; } 80% { translate:-7px 17px; } }
  .replica-reveal .ink-underline::after,.ink-underline.replica-reveal::after { animation-duration:1.4s; animation-delay:.9s; }
}
