/* Home 06 safe for children (short): a classroom chart on a mint wall. Cream chart paper mounted on a sun-yellow
   backing sheet, taped at the top corners, with four promises written on it and a link to the questions page, a sky sticky note at the corner, and a paper
   girl waving beside it. The chart is taped up once when it is seen (on twos); see 09-trust.js. */

/* overflow-x: clip keeps the turned paper from widening the page on phones; unlike hidden it leaves the edge that
   hangs below the section visible */
.sf { overflow-x: clip; }
.sf__wall { position: relative; }
.sf__board { position: relative; isolation: isolate; max-width: 1100px; margin: 0 auto; rotate: .4deg; }
/* the coloured backing sheet the chart is mounted on */
.sf__board::before { content: ""; position: absolute; inset: -16px -18px -18px -16px; z-index: -1; border-radius: 9px 13px 11px 8px / 8px 11px 13px 9px;
  background: var(--sun) url(/assets/art/textures/grain-soft-tile.webp) 0 0 / 256px 256px; background-blend-mode: multiply; rotate: -1.4deg;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 1.5px rgba(31, 107, 58, .35), 0 24px 40px -22px rgba(31, 107, 58, .6); }
.sf__chart { position: relative; isolation: isolate; padding: clamp(40px, 5vw, 68px) clamp(22px, 5vw, 68px) clamp(48px, 5.5vw, 72px);
  background: var(--card) url(/assets/art/textures/paper-tile.webp) 0 0 / 512px 512px; color: var(--ink);
  border-radius: 6px 10px 8px 5px / 5px 8px 10px 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 1.5px rgba(90, 42, 0, .28), 0 14px 26px -16px rgba(90, 42, 0, .45); }
.sf__tape { z-index: 3; font-size: 18px; }
.sf__tape--l { left: 5%; top: -.7em; --pk-tilt: -7deg; }
.sf__tape--r { right: 5%; top: -.7em; --pk-tilt: 6deg; }

.sf__head { max-width: 46rem; }
.sf__h { font-size: var(--t-h2); }
.sf__lead { margin-top: 18px; font-size: var(--t-lead); line-height: 1.55; color: var(--ink-2); }
.sf__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(30px, 3.4vw, 44px) clamp(24px, 3.4vw, 48px); margin-top: clamp(36px, 4.4vw, 56px); }
.sf__item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; align-content: start; }
/* Round 3: one icon family (ui-r3/safe-*): a pastel paper disc with one clean pictogram. The disc is 75% of the
   picture (the rest is its shadow), so the margins line the disc up with the words. */
.sf__icon { width: 88px; height: 88px; max-width: none; margin: -2px 0 -12px -11px; }
.sf__t { font-size: clamp(20px, 1.7vw, 23px); line-height: 1.2; padding-top: 2px; }
.sf__item p { color: var(--ink-2); font-size: var(--t-body); line-height: 1.5; }
.sf__more { margin-top: clamp(26px, 3vw, 36px); }
.sf__more a { display: inline-flex; align-items: center; min-height: 44px; font: 800 18px/1.2 var(--font-body); color: var(--blue-deep); text-decoration-thickness: 2px; }
.sf__note.pk-note { --pk-note-w: 20rem; --pk-tilt: 2.5deg; position: absolute; z-index: 2; right: clamp(-28px, -2vw, -12px); bottom: clamp(-62px, -4vw, -38px);
  min-height: 0; font: 700 17px/1.4 var(--font-display); }
.sf__kid { position: absolute; z-index: 2; left: clamp(-10px, 0vw, 4px); top: -64px; bottom: auto; width: 84px; height: auto; pointer-events: none; }
.sf__chart { margin-bottom: 0; }
.sf__wall { padding-bottom: 56px; }

@media (max-width: 1099.98px) {
  .sf__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf__item { grid-template-columns: 62px minmax(0, 1fr); gap: 6px 16px; }
  .sf__icon { grid-row: span 2; margin: -4px 0 0 -10px; }
  .sf__note.pk-note { position: relative; right: auto; bottom: auto; margin: 36px 0 0 auto; }
  .sf__wall { padding-bottom: 72px; }
  .sf__kid { width: 72px; top: auto; bottom: -64px; left: 2%; }
}
@media (max-width: 639.98px) {
  .sf__board { rotate: .15deg; }
  .sf__board::before { inset: -10px -8px -12px -8px; rotate: -.6deg; }
  .sf__list { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .sf__item { grid-template-columns: 54px minmax(0, 1fr); gap: 4px 14px; }
  .sf__icon { width: 70px; height: 70px; margin: -4px 0 0 -9px; }
  .sf__note.pk-note { --pk-note-w: 100%; margin: 32px 0 0; }
  .sf__kid { width: 59px; top: auto; bottom: -66px; left: auto; right: 4%; }
}

/* ---------- Taping the chart up (on twos). Pre-states only while a piece waits for its entrance. */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.rm) .sf [data-b].b-wait:not(.b-in) { opacity: 0; }
  .sf [data-b].b-in { animation: var(--b-anim) var(--b-dur, 500ms) steps(1, end) var(--b-at, 0ms) both; }
  .sf [data-b="chart"] { --b-anim: sf-hang; --b-dur: 670ms; }
  .sf [data-b="item"] { --b-anim: sf-stick; --b-dur: 330ms; }
  .sf [data-b="note"] { --b-anim: sf-note; --b-dur: 420ms; }
  .sf [data-b="kid"] { --b-anim: sf-hop; --b-dur: 500ms; }
  .sf .sf__board.b-in .sf__tape { animation: sf-tape 330ms steps(1, end) calc(var(--b-at, 0ms) + 500ms) both; }
  .sf__kid.is-wave { animation: sf-wave 830ms steps(1, end); transform-origin: 50% 100%; }
}
@keyframes sf-hang {
  0% { opacity: 0; transform: translateY(-26px) rotate(-2.4deg); }
  12.5% { opacity: 1; transform: translateY(-15px) rotate(-1.6deg); }
  25% { transform: translateY(-7px) rotate(-.9deg); }
  37.5% { transform: translateY(-2.5px) rotate(.3deg); }
  50% { transform: translateY(0) rotate(.5deg); }
  62.5% { transform: rotate(-.15deg); }
  75%, 100% { opacity: 1; transform: none; }
}
@keyframes sf-tape { 0% { opacity: 0; transform: scale(1.3) translateY(-6px); } 25% { opacity: 1; transform: scale(1.08); } 50%, 100% { opacity: 1; transform: none; } }
@keyframes sf-stick { 0% { opacity: 0; transform: translateY(8px) scale(.97); } 25% { opacity: 1; transform: translateY(3px) scale(.99); } 50%, 100% { opacity: 1; transform: none; } }
@keyframes sf-note { 0% { opacity: 0; transform: translate(14px, -18px) rotate(8deg) scale(1.06); } 20% { opacity: 1; transform: translate(6px, -8px) rotate(4deg) scale(1.03); } 40% { transform: translate(1px, -2px) rotate(1deg); } 60%, 100% { opacity: 1; transform: none; } }
@keyframes sf-hop { 0% { opacity: 0; transform: translateY(18px); } 16.67% { opacity: 1; transform: translateY(6px) scale(1.03, .96); } 33.33% { transform: translateY(-8px) scale(.98, 1.03); } 50% { transform: translateY(0) scale(1.03, .97); } 66.67%, 100% { opacity: 1; transform: none; } }
@keyframes sf-wave { 0% { transform: rotate(0); } 10% { transform: rotate(-3deg); } 20% { transform: rotate(2.5deg); } 30% { transform: rotate(-2.5deg); } 40% { transform: rotate(2deg); } 50%, 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sf [data-b], .sf__tape, .sf__kid { animation: none !important; opacity: 1 !important; transform: none !important; }
}
@media (prefers-contrast: more) {
  .sf__chart { box-shadow: inset 0 0 0 2px var(--ink); }
  .sf__item p, .sf__lead { color: var(--ink); }
}
@media (forced-colors: active) {
  .sf__chart { border: 2px solid CanvasText; }
  .sf__board::before { display: none; }
}
