/* The portrait, distant dragon and foreground copy occupy separate depth planes. */
.coast-photo,.coast::after,.dragon-route { position:absolute; pointer-events:none; }
.coast-photo { inset:0; width:100%; height:100%; object-fit:cover; object-position:50% 44%; z-index:-3; }
.coast::after { content:""; inset:0; z-index:-1; background:linear-gradient(90deg,#091022c9, #0b152152 44%, transparent 67%); }
.dragon-route { left:13%; top:14%; width:clamp(88px,9.5vw,170px); z-index:-2; animation:coastal-flight 25s linear infinite; }
.dragon { display:block; width:100%; height:auto; opacity:.86; transform-origin:55% 48%; animation:coastal-glide 2.9s ease-in-out infinite alternate; }
@keyframes coastal-flight {
  0% { transform:translate(0,0) rotate(-5deg); opacity:1; }
  35% { transform:translate(25vw,-2.5vh) rotate(-3deg); opacity:1; }
  75% { transform:translate(57vw,1vh) scale(.82) rotate(5deg); opacity:1; }
  94% { transform:translate(78vw,-2vh) scale(.65); opacity:0; }
  95% { transform:translate(-15vw,3vh); opacity:0; }
  100% { transform:translate(0,0) rotate(-5deg); opacity:1; }
}
@keyframes coastal-glide { to { transform:perspective(360px) rotateX(20deg) rotate(-3deg) translateY(-4px); } }
/* The wrist leads the downstroke and the outer membrane folds on recovery. */
#flight-wing { animation:wing-stroke 1.48s ease-in-out infinite; }
@keyframes wing-stroke {
  0%,100% { d:path("M118 63 Q109 50 105 29 Q86 13 58 5 Q72 18 75 29 Q63 22 49 23 Q64 32 68 42 Q54 35 44 37 Q62 49 71 61 Q79 52 88 62 Q99 55 108 67 Z"); }
  23% { d:path("M118 63 Q112 63 116 61 Q91 50 49 39 Q64 49 69 54 Q53 47 38 47 Q52 53 62 60 Q48 57 37 57 Q59 66 72 67 Q80 60 90 66 Q99 61 108 67 Z"); }
  47% { d:path("M118 63 Q119 77 116 87 Q97 107 68 119 Q76 106 79 97 Q64 108 53 110 Q67 96 71 86 Q60 91 52 92 Q67 76 77 68 Q84 77 92 69 Q100 75 108 67 Z"); }
  74% { d:path("M118 63 Q105 61 98 55 Q84 68 66 84 Q74 71 75 66 Q64 74 58 76 Q68 65 68 60 Q59 64 54 65 Q66 54 75 54 Q82 59 89 59 Q98 59 108 67 Z"); }
}
.coast[data-still] #flight-wing,.coast[data-offscreen] #flight-wing { animation-play-state:paused; }
@supports not (d:path("M0 0L1 1")) {
  #flight-wing { transform-origin:116px 64px; animation-name:wing-pivot; }
  @keyframes wing-pivot { 48% { transform:skewX(-12deg) scaleY(-.8); } }
}
.coast[data-still] .dragon-route,.coast[data-still] .dragon,.coast[data-offscreen] .dragon-route,.coast[data-offscreen] .dragon { animation-play-state:paused; }
.motion-toggle { position:absolute; right:clamp(1rem,4vw,4rem); top:1rem; width:40px; height:40px; border:1px solid #ffffff65; color:#fff; background:#101827b5; border-radius:50%; }
.motion-toggle:hover { background:#141d33; }
.mode-guide { padding-block:clamp(2.75rem,6vw,5rem); display:grid; grid-template-columns:1fr 1fr; gap:clamp(1.5rem,6vw,6rem); align-items:center; }
.guide-copy p,.story-notes p,.pricing-intro,.memory-note p { color:var(--muted); margin-top:.9rem; max-width:62ch; }
.mode-example { position:relative; margin:0; border:1px solid var(--line); border-radius:1.1rem; padding:1rem clamp(1rem,3vw,2rem) 1.4rem; background:var(--panel); }
.mode-example legend { font-weight:650; color:var(--text); padding:0 .45rem; }
.mode-example input { position:absolute; width:1px; height:1px; clip-path:inset(50%); }
.mode-example label { display:inline-block; padding:.4rem .8rem; border-radius:.6rem; color:var(--muted); cursor:pointer; }
.mode-example input:checked + label { background:var(--accent); color:var(--on-accent); }
.mode-example input:focus-visible + label { outline:2px solid var(--accent); outline-offset:3px; }
.example-text { display:none; gap:.65rem; margin-top:1rem; }
#example-chat:checked ~ .chat-example,#example-story:checked ~ .story-example { display:grid; }
.example-text p { width:fit-content; max-width:90%; background:var(--bg); border-radius:.9rem; padding:.65rem .9rem; }
.example-text p:first-child { justify-self:end; }
.example-text b { display:block; font-size:.8rem; color:var(--accent); }
.story-notes { display:grid; grid-template-columns:minmax(140px,.75fr) 1fr 1fr; align-items:center; gap:clamp(1.5rem,4vw,4rem); padding-bottom:2rem; }
.library-guide { display:block; width:100%; height:auto; border-radius:1.2rem; }
.story-notes article { border-top:1px solid var(--line); padding-top:1.3rem; }
.story-notes h2 { font-size:1.55rem; }
.story-notes a { display:inline-block; margin-top:.9rem; color:var(--accent); }
.pricing-intro { margin:0 0 1.1rem; }
.memory-note { margin-top:1rem; }
.android-section { padding-bottom:clamp(2rem,5vw,4rem); }
.android-card { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1.25rem; padding:clamp(1.25rem,3vw,2.3rem); border:1px solid var(--line); border-radius:1rem; background:var(--panel); }
.android-card p { margin-top:.7rem; max-width:58ch; color:var(--muted); }
.apk-status { color:var(--muted); padding:.4rem .85rem; border:1px solid var(--line); border-radius:2rem; white-space:nowrap; }
@media(max-width:760px) {
  .coast-photo { object-position:68% top; }
  .coast::after { background:linear-gradient(0deg,#0a1122 0%,#101727dc 39%,transparent 83%); }
  .dragon-route { left:4%; top:12%; }
  .mode-guide,.story-notes { grid-template-columns:1fr; }
  .library-guide { max-height:240px; object-fit:cover; object-position:50% 38%; }
}
@media(prefers-reduced-motion:reduce) {
  .dragon-route,.dragon,#flight-wing { animation:none; }
  .motion-toggle { display:none; }
}
