.story-text p:first-child::first-letter {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.8rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: .91;
  color: #422a25;
  display: block;
  margin: .055em .18em .015em 0;
  padding: .18em .25em .15em;
  border-radius: .11em;
  background: #f6dea2 url('illustrations/initial-ornament.svg') center / 100% 100% no-repeat;
  text-shadow: 1px 1px #fff1bb;
}
.page.night-theme .story-text p:first-child::first-letter { color: #342638; }

.pebble-stage { position: relative; isolation: isolate; }
.pebble-stage > img { display: block; width: 100%; aspect-ratio: 16 / 9; }
.pebble-water { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.pebble-target { fill: transparent; cursor: crosshair; pointer-events: fill; touch-action: pan-y pinch-zoom; }
.pebble-in-flight { fill: #b7a590; stroke: #4e493c; stroke-width: 2.5; }
.pebble-ripples ellipse, .pebble-splash { fill: none; stroke: #fff7d8; stroke-width: 3.5; stroke-linecap: round; }
.pebble-ripples ellipse { animation: pebble-ripple 1.08s cubic-bezier(.15,.56,.3,1) both; }
.pebble-ripples ellipse:nth-child(2) { animation-delay: .13s; }
.pebble-ripples ellipse:nth-child(3) { animation-delay: .25s; }
.pebble-splash { animation: pebble-spray .44s ease-out both; }
.gull-course { offset-anchor: 0 0; offset-rotate: 0deg; }
.gull-course-0 { offset-path: path('M0 0 C45 -28 136 -66 160 -45 S85 8 44 12 Q8 16 0 0 Z'); }
.gull-course-1 { offset-path: path('M0 0 C30 -24 98 -50 118 -34 S50 22 20 16 Q0 12 0 0 Z'); }
.gull-course-2 { offset-path: path('M0 0 C36 -18 97 -31 106 -14 S59 19 25 16 Q4 12 0 0 Z'); }
@media (prefers-reduced-motion: no-preference) {
  .pebble-gulls.is-flying .gull-course { animation: gull-lap var(--lap) var(--launch) cubic-bezier(.34,0,.31,1) both; }
  .pebble-gulls.is-flying .gull-bank { animation: gull-bank var(--lap) var(--launch) ease-in-out both; }
  .pebble-gulls.is-flying .gull-near-wing { animation: gull-wing var(--beat) var(--launch) ease-in-out 4; }
  .pebble-gulls.is-flying .gull-far-wing { animation: gull-wing var(--beat) var(--launch) ease-in-out 4 reverse; }
}
@keyframes gull-lap { to { offset-distance: 100%; } }
@keyframes gull-bank {
  0%,100% { transform: rotate(0deg) scale(1); }
  33% { transform: rotate(-8deg) scale(.94,.93); }
  47% { transform: rotate(14deg) scale(.3,.84); }
  60%,82% { transform: rotate(-6deg) scale(-.83,.87); }
  93% { transform: rotate(10deg) scale(-.35,.94); }
}
@keyframes gull-wing { 0%,100% { transform: none; } 38% { transform: rotate(-9deg) scaleY(-.35); } 76% { transform: rotate(4deg) scaleY(1.24); } }
@keyframes pebble-ripple { from { transform: scale(.1); opacity: .9; } 64% { opacity: .68; } to { transform: scale(1); opacity: 0; } }
@keyframes pebble-spray { from { transform: scale(.1); opacity: 1; } 55% { opacity: 1; } to { transform: scale(1); opacity: 0; } }
.pebble-panel { padding: clamp(12px,3vw,24px); background: #fff1c9; color: #163e46; border-top: 2px solid #c89a5e; }
.pebble-heading h3 { font-family: Georgia,serif; font-size: clamp(1.38rem,3vw,2rem); margin: 0 0 2px; }
.pebble-panel p { margin: 0; line-height: 1.4; font-size: .95rem; }
.pebble-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 12px; }
.pebble-result { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 6px; align-items: center; }
.pebble-marks { display: flex; align-items: center; gap: 4px; }
.pebble-marks i { display: block; width: 22px; height: 17px; border: 1px dashed #6b5d40; border-radius: 59% 48% 49% 42%; }
.pebble-marks .is-wet { background: #198477; border: 2px solid #1a625f; box-shadow: inset 2px 2px #83c4ae; }
.pebble-panel .pebble-speech-note:not(:empty) { margin-top: 8px; }
#illus-ch2:has(.pebble-stage) > .ripple-scene { display: none; }
@media (prefers-reduced-motion: reduce) {
  .pebble-ripples ellipse { animation: none; opacity: .86; }
  .pebble-splash { animation: none; opacity: 1; }
}

.photo-dialog {
  width: min(1320px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  padding: 0;
  border: 1px solid #496971;
  border-radius: 18px;
  background: #10262f;
  color: #fcf5da;
}
.photo-dialog-head { margin: 0; padding: 8px 12px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
.photo-context { overflow-wrap: anywhere; }
.photo-dialog .log-btn { border-color: #48636c; background: #1e3c46; color: #fff8e0; }
.photo-dialog .log-btn:hover { background: #31535d; }
.photo-dialog-head .photo-dialog-controls { margin: 0; gap: 2px; background: #1e3c46; border-radius: 9px; }
.photo-dialog-head .log-btn { padding: 4px 8px; min-width: 44px; border-color: transparent; }
#lightboxClose, #photoZoom, #photoZoomOut { font-size: 1.4rem; line-height: 1; }
#photoFit { font-variant-numeric: tabular-nums; }
#photoScale { font-size: .82rem; }
.photo-viewport { position: relative; }
.photo-dialog-stage { height: clamp(148px, 64dvh, 840px); background: #07171e; border-radius: 0; cursor: zoom-in; }
.photo-dialog-stage:focus-visible { outline-offset: -3px; }
.photo-viewport > .log-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  min-width: 44px; min-height: 49px; border-radius: 28px;
  background: #122b35ee; font-size: 1.8rem; line-height: 1;
}
#photoPrev { left: 8px; }
#photoNext { right: 8px; }
.photo-filmstrip {
  position: relative; display: flex; gap: 7px; overflow-x: auto; padding: 9px 12px;
  overscroll-behavior-inline: contain; scrollbar-width: thin; background: #142f39;
}
.photo-thumb { flex: 0 0 55px; height: 52px; border: 2px solid transparent; border-radius: 7px; padding: 2px; background: none; opacity: .68; cursor: pointer; }
.photo-thumb[aria-current=true], .photo-thumb:hover { border-color: #ffd885; opacity: 1; }
.photo-thumb:focus-visible { outline-offset: -1px; }
.photo-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 3px; }
.photo-description { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; padding: 8px 12px; }
.photo-description .photo-dialog-caption { flex: 1 1 230px; margin: 0; }
.photo-description .speech-note { flex-basis: 100%; margin: 0; }
.photo-description .speech-note:empty { display: none; }
@media (max-width: 480px) {
  .photo-dialog { width: calc(100% - 10px); max-height: calc(100% - 12px); }
  .photo-dialog-stage { height: 54dvh; }
  .photo-dialog-head { padding: 5px; }
  .photo-context { font-size: .77rem; }
  .photo-viewport > .log-btn { min-height: 44px; }
  #photoPrev { left: 4px; }
  #photoNext { right: 4px; }
}
@media print {
  .pebble-water, .pebble-panel, .stamp-shine { display: none !important; }
}
