/* Diary 01 hero: a brown-paper notebook cover. The page title, then the paper phone with Thursday's page (the paper
   kit's diary card, sample data) and the four things a parent sees tonight taped to the kraft beside the slips they
   point at. Motion: when the phone is seen, its slips are laid on the page one by one on twos and each note is taped
   down after its slip (01-hero.js). */

.diary { --diary-fg2: #57391A; --diary-phone-w: clamp(280px, 25vw, 360px); overflow: clip visible; }
.dh { padding-top: clamp(44px, 6vw, 84px); }
.diary p { color: var(--diary-fg2); }
.diary h2, .diary h3 { color: var(--ink); }

.diary__head { position: relative; max-width: 50rem; margin-inline: auto; text-align: center; }
.dh__h { color: var(--ink); }
.dh__h1 { display: block; font: 800 clamp(44px, 6.4vw, 92px)/1 var(--font-display); letter-spacing: -.02em; }
.dh__h2 { display: block; margin-top: clamp(8px, 1vw, 14px); font: 800 clamp(22px, 2.3vw, 33px)/1.15 var(--font-display); letter-spacing: -.01em; }
.diary .diary__lead { margin: clamp(14px, 1.6vw, 20px) auto 0; max-width: 32em; font: 650 var(--t-lead)/1.5 var(--font-body); color: var(--ink); }
/* Round 3 (owner: "Free must be a proper, very visible rubber stamp, not a small pill"): under the title, the FREE
   stamp pressed in green ink (paper-kit .pk-rubber), beside two small paper facts. */
.dh__glance { margin-top: clamp(20px, 2.2vw, 30px); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px clamp(24px, 3.4vw, 46px); }
.dh__free { margin: 0; padding: 6px; }
.dh__stamp { --pk-ink: #125730; --pk-rubber-fs: clamp(44px, 4.2vw, 58px); --pk-rubber-turn: -8deg; --pk-rubber-at: 350ms; } /* a shade darker on kraft: AA for the small words */
.dh__facts { display: grid; gap: 10px; justify-items: start; text-align: left; }
.dh-fact { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 18px 8px 10px; rotate: -1deg;
  border-radius: 10px 13px 11px 9px / 9px 11px 13px 10px; background: var(--card) url(/assets/art/textures/paper-tile.webp) 0 0 / 512px 512px; color: var(--ink);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(90, 42, 0, .24), 0 8px 12px -8px rgba(90, 42, 0, .5); }
.dh-fact:nth-child(2) { rotate: .8deg; margin-left: 16px; }
.dh-fact__art { flex: none; display: flex; align-items: center; }
.dh-fact__art svg { width: 38px; height: 38px; }
/* three little letter tiles: Tamil, Hindi, English */
.dh-fact--lang .dh-fact__art i { display: grid; place-items: center; width: 27px; height: 31px; margin-right: -3px; border-radius: 6px 7px 6px 5px; font: 800 17px/1 var(--font-body); font-style: normal;
  color: var(--ink); background: var(--lemon); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 1px rgba(90, 42, 0, .28); rotate: -6deg; }
.dh-fact--lang .dh-fact__art i:nth-child(2) { background: var(--pink); rotate: 4deg; translate: 0 -2px; }
.dh-fact--lang .dh-fact__art i:nth-child(3) { background: var(--sky); rotate: -2deg; margin-right: 0; }
.dh-fact__text { display: grid; gap: 1px; }
.dh-fact__text b { font: 800 17px/1.25 var(--font-body); }
.dh-fact__text span { font: 650 15px/1.3 var(--font-body); color: var(--ink-2); }
.dh__actions { margin-top: clamp(22px, 2.4vw, 30px); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; }
.dh__btn { position: relative; }

/* ---------------------------------------------------------------- paper on the desk (R2 motion): a pencil, crayons, a
   stack of books and a school bag lie on the kraft beside the title, at different depths: they drift against the
   scroll at their own speeds (data-depth) and breathe a little on twos (data-idle, life.js). Wide screens only, never
   over text. */
.dh { position: relative; isolation: isolate; }
.dh > .wrap { position: relative; z-index: 1; }
.dh__props { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: none; }
.dh__prop { position: absolute; display: block; }
.dh__prop img { display: block; width: 100%; height: auto; }
.dh__prop--pencil { left: max(16px, calc(50% - 640px)); top: 92px; width: clamp(120px, 11vw, 168px); rotate: -28deg; }
.dh__prop--crayons { left: calc(max(16px, calc(50% - 640px)) + 60px); top: 300px; width: 76px; rotate: 10deg; }
.dh__prop--crayons img { transform-origin: 50% 100%; }
.dh__prop--books { right: max(16px, calc(50% - 650px)); top: 286px; width: clamp(120px, 10vw, 150px); rotate: -4deg; }
.dh__prop--bag { right: calc(max(16px, calc(50% - 650px)) + 40px); top: 120px; width: 74px; rotate: 8deg; }
@media (min-width: 1240px) { .dh__props { display: block; } }


/* ---------------------------------------------------------------- the phone and its four notes */
.diary__tonight-title { margin-top: clamp(56px, 6vw, 88px); text-align: center; font-size: clamp(28px, 2.8vw, 40px); }
.diary__show { position: relative; margin-top: clamp(20px, 2.4vw, 30px); --gap: clamp(26px, 3.6vw, 60px); }
.diary__tonight { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.diary__note { position: absolute; width: min(340px, calc(50% - var(--diary-phone-w) / 2 - var(--gap))); pointer-events: auto;
  display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: start; padding: 18px 20px 18px 16px;
  border-radius: 4px 6px 16px 5px / 5px 4px 8px 6px; background: var(--note, var(--lemon)); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 1px rgba(90, 42, 0, .25), 5px 14px 16px -12px rgba(90, 42, 0, .55); }
.diary__note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 76px; height: 21px; translate: -50% 0; rotate: -3deg; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 60%), rgba(250, 244, 230, .72);
  clip-path: polygon(0 9%, 4% 0, 96% 3%, 100% 14%, 97% 32%, 100% 51%, 96.5% 70%, 100% 88%, 95% 100%, 5% 97%, 0 86%, 3% 66%, 0 47%, 3.5% 28%); }
.diary__note::after { content: ""; position: absolute; top: 50%; height: 2px; width: calc(var(--gap) - 6px);
  background: repeating-linear-gradient(90deg, rgba(30, 42, 90, .5) 0 6px, transparent 6px 11px); }
.diary__note > :first-child { grid-row: span 2; width: 52px; height: 52px; }
.diary__note b { font: 800 20px/1.2 var(--font-display); padding-top: 2px; }
.diary__note span:last-child { font-size: 16.5px; line-height: 1.45; color: var(--ink-2); }
.diary__note--hw { --note: var(--lemon); right: calc(50% + var(--diary-phone-w) / 2 + var(--gap)); top: 24%; rotate: -1.6deg; }
.diary__note--bring { --note: #FFE0E6; left: calc(50% + var(--diary-phone-w) / 2 + var(--gap)); top: 40%; rotate: 1.4deg; }
.diary__note--sign { --note: var(--mint); right: calc(50% + var(--diary-phone-w) / 2 + var(--gap)); top: 56%; rotate: 1deg; }
.diary__note--notice { --note: var(--sky); left: calc(50% + var(--diary-phone-w) / 2 + var(--gap)); top: 73%; rotate: -1.2deg; }
.diary__note--hw::after, .diary__note--sign::after { left: 100%; margin-left: 4px; }
.diary__note--bring::after, .diary__note--notice::after { right: 100%; margin-right: 4px; }
.diary__note--bring::before { rotate: 4deg; } .diary__note--notice::before { left: 38%; }
.diary__pinned { position: relative; display: block; }
.diary__pinned::before { content: ""; position: absolute; left: 8px; top: 8px; width: 36px; height: 38px; border-radius: 2px 3px 8px 2px; rotate: -5deg;
  background: repeating-linear-gradient(transparent 0 7px, rgba(35, 70, 198, .4) 7px 9px) 6px 10px / 24px 23px no-repeat, var(--lemon);
  box-shadow: 0 1px 1px rgba(90, 42, 0, .28), 2px 5px 6px -3px rgba(90, 42, 0, .4); }
.diary__pinned::after { content: ""; position: absolute; left: 21px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #FFD0CB 0 18%, transparent 19%), var(--coral); box-shadow: 0 1px 1px rgba(90, 42, 0, .35); }

.diary__phone { position: relative; width: var(--diary-phone-w); margin: 0 auto; }
.diary__device { position: relative; aspect-ratio: 282 / 526; container-type: inline-size; rotate: -1.5deg; }
.diary__device > img { position: absolute; display: block; max-width: none; height: auto; }
.diary__device-back { left: 0; top: 0; width: 100%; }
.diary__device-screen { left: 8.865%; top: 5.513%; width: 82.27%; }
.diary__device-bezel { left: 4.61%; top: .57%; width: 90.78%; pointer-events: none; }
.diary__screen { position: absolute; left: 9.93%; top: 6.08%; width: 80.14%; height: 84.41%; overflow: hidden; border-radius: 9.2cqi;
  container-type: inline-size; padding-top: 11cqi; color: var(--ink); }
.diary__screen > * { --pk-fs: 5.15cqi; font-size: 5.15cqi; }
.diary__app { display: flex; align-items: center; gap: .45em; padding: 0 .9em .5em; }
.diary__app img { width: 1.75em; height: 1.75em; }
.diary__app b { font-size: 1.12em; color: var(--blue); }
.diary__app .pk-chip { margin-left: auto; font-size: .78em; }
.diary__screen .pk-diary { margin: 0 .55em; --pk-pad: .85em .8em .9em; gap: .55em; }
.diary__screen .pk-diary p { color: inherit; }
.diary__screen .pk-diary .pk-meta, .diary__screen .pk-diary .pk-label { color: var(--ink-2); }
.diary__sticker { position: absolute; right: -26px; top: 3%; z-index: 3; padding: 9px 16px; rotate: 11deg; border-radius: 999px;
  background: var(--sky); color: var(--blue-deep); font: 800 16px/1 var(--font-body); letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px #FFFFFF99, 0 1px 1px rgba(11, 26, 85, .3), 0 8px 12px -8px rgba(11, 26, 85, .45); }

/* ---------------------------------------------------------------- motion: slips laid on twos, notes taped down */
@keyframes diary-lay {
  0% { transform: translate(-3%, -18%) rotate(-4deg) scale(1.12); opacity: 1; animation-timing-function: var(--pm-fall); }
  44% { transform: translate(0, 0) rotate(0deg) scale(1.03, .97); animation-timing-function: var(--pm-spring); }
  100% { transform: none; opacity: 1; }
}
/* a sticky note is pinned beside its slip: it drops, the pin catches, it swings and hangs (paper motion "pin") */
@keyframes diary-pin {
  0% { opacity: 0; transform: translateY(-22px) rotate(-12deg) scale(1.05); animation-timing-function: var(--pm-fall); }
  22% { opacity: 1; }
  30% { opacity: 1; transform: translateY(0) rotate(6.5deg) scale(1.02, .96); animation-timing-function: var(--pm-wobble); }
  100% { opacity: 1; transform: none; }
}
/* each row on the phone's page ticks in after its slip is laid */
@keyframes diary-row {
  0% { opacity: 0; transform: translateX(-12px); animation-timing-function: var(--pm-glide); }
  55% { opacity: 1; transform: translateX(1.5px); animation-timing-function: var(--pm-spring); }
  100% { opacity: 1; transform: none; }
}
/* the phone is in the first view: its slips and notes wait without the script's help, with a 3 s failsafe */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .diary__show:not(.is-in) [data-slip], .diary__show:not(.is-in) .diary__note { opacity: 0; animation: diary-failsafe 1ms 3s forwards; }
}
@keyframes diary-failsafe { to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.rm) .diary.is-live .diary__show.is-in [data-slip] { animation: diary-lay 620ms linear both; animation-delay: var(--d, 0ms); }
  html.js:not(.rm) .diary.is-live .diary__show.is-in .diary__note { transform-origin: 50% 8px; animation: diary-pin 900ms linear both; animation-delay: var(--d, 0ms); }
  html.js:not(.rm) .diary.is-live .diary__show.is-in [data-slip] :is(li, .pk-diary__item, .pk-sig) { animation: diary-row 300ms linear backwards;
    animation-delay: calc(var(--d, 0ms) + 380ms + var(--k, 0) * 90ms); }
  html.js:not(.rm) .diary.is-live .diary__show [data-slip] li:nth-child(2) { --k: 1; }
  html.js:not(.rm) .diary.is-live .diary__show [data-slip] li:nth-child(3) { --k: 2; }
  html.js:not(.rm) .diary.is-live .diary__show [data-slip]:nth-of-type(1) { --d: 200ms; }
  html.js:not(.rm) .diary.is-live .diary__note--hw { --d: 450ms; }
  html.js:not(.rm) .diary.is-live .diary__show [data-slip]:nth-of-type(2) { --d: 700ms; }
  html.js:not(.rm) .diary.is-live .diary__note--bring { --d: 950ms; }
  html.js:not(.rm) .diary.is-live .diary__show [data-slip]:nth-of-type(3) { --d: 1200ms; }
  html.js:not(.rm) .diary.is-live .diary__note--sign { --d: 1450ms; }
  html.js:not(.rm) .diary.is-live .diary__show [data-slip]:nth-of-type(4) { --d: 1700ms; }
  html.js:not(.rm) .diary.is-live .diary__note--notice { --d: 1950ms; }
}

/* ---------------------------------------------------------------- tablets and phones: notes under the phone */
@media (max-width: 1060px) {
  .diary__tonight { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 24px; margin-top: 44px; pointer-events: auto; }
  .diary__note { position: relative; inset: auto; width: auto; max-width: none; }
  .diary__note::after { display: none; }
  .diary__show { display: flex; flex-direction: column; }
  .diary__phone { order: 2; }
  .diary__tonight { order: 3; }
}
@media (max-width: 760px) {
  .diary__tonight { grid-template-columns: 1fr; }
  .dh__glance { gap: 12px 18px; }
  .dh__stamp { --pk-rubber-fs: 40px; }
  .dh-fact:nth-child(2) { margin-left: 0; }
  .dh__actions .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .diary__sticker { right: -10px; }
}
@media (forced-colors: active) {
  .diary__note { border: 1px solid CanvasText; }
}

/* R5: Suri, live in 3D (static picture first). Below the title on small screens; at the right of the title on wide ones, where the paper bag and books used to lie. */
.dh__suri { width: min(78%, 300px); margin: clamp(26px, 4vw, 40px) auto 0; }
@media (min-width: 1300px) {
  .dh__suri { position: absolute; z-index: 2; right: -96px; top: 150px; width: 300px; margin: 0; }
  .dh__prop--bag, .dh__prop--books { display: none; }
}
